From 368d66f76eb8832b1f8f1da37ccb20d405bcf4a7 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Sun, 25 Sep 2011 16:59:44 -0700 Subject: [PATCH] Copy the input frame, it should not be modified in place. --- AppKit/CPStepper.j | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/AppKit/CPStepper.j b/AppKit/CPStepper.j index cf5e101ed..31949c952 100644 --- a/AppKit/CPStepper.j +++ b/AppKit/CPStepper.j @@ -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"]]; }