Fix for providing too many image slices breaking CPView.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-05-31 13:45:58 -07:00
parent ef9053f1ba
commit 18a0e7f0d2
+4 -4
View File
@@ -1208,7 +1208,7 @@ var DOMElementPrototype = nil,
amount = 0 - _DOMImageParts.length;
}
if (amount > 0)
while (amount--)
{
@@ -1236,16 +1236,16 @@ var DOMElementPrototype = nil,
else
{
var slices = [patternImage imageSlices],
count = slices.length,
count = MIN(_DOMImageParts.length, slices.length),
frameSize = _frame.size;
while (count--)
{
var image = slices[count],
size = _DOMImageSizes[count] = image ? [image size] : _CGSizeMakeZero();
CPDOMDisplayServerSetStyleSize(_DOMImageParts[count], size.width, size.height);
_DOMImageParts[count].style.background = image ? "url(\"" + [image filename] + "\")" : "";
}