Copy the input frame, it should not be modified in place.

This commit is contained in:
Aparajita Fishman committed 2011-09-25 16:59:44 -07:00
1 parent 5aaae61b46
commit 368d66f76e
1 file changed
+7 -5
+7 -5
View File
@@ -125,10 +125,12 @@
{
var upSize = [self valueForThemeAttribute:@"up-button-size"],
downSize = [self valueForThemeAttribute:@"down-button-size"],
minSize = CGSizeMake(upSize.width, upSize.height + downSize.height);
aFrame.size.width = Math.max(minSize.width, aFrame.size.width);
aFrame.size.height = Math.max(minSize.height, aFrame.size.height);
[super setFrame:aFrame];
minSize = _CGSizeMake(upSize.width, upSize.height + downSize.height),
frame = _CGRectMakeCopy(aFrame);
frame.size.width = Math.max(minSize.width, frame.size.width);
frame.size.height = Math.max(minSize.height, frame.size.height);
[super setFrame:frame];
}
/*! @ignore
@@ -219,7 +221,7 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], CGSizeMakeZero(), CGSizeMakeZero()]
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], _CGSizeMakeZero(), _CGSizeMakeZero()]
forKeys:[@"bezel-color-up-button", @"bezel-color-down-button", @"up-button-size", @"down-button-size"]];
}