From 18a0e7f0d2a7a38f94b4285c97ffa0de1f7bf468 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Sun, 31 May 2009 13:44:58 -0700 Subject: [PATCH] Fix for providing too many image slices breaking CPView. Reviewed by me. --- AppKit/CPView.j | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 61cba8ec6..2974ed616 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -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] + "\")" : ""; }