From c3b5dc747a85262ebcb1b009ed7ffdd63d15e5c6 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Thu, 30 Sep 2010 17:27:06 -0400 Subject: [PATCH] CPButton bezelRectForBounds and contentRectForBounds were modifying the bounds parameter in place without copying it. --- AppKit/CPButton.j | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index dcd0c8315..59b5b5156 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -435,6 +435,7 @@ CPButtonImageOffset = 3.0; if (_CGInsetIsEmpty(contentInset)) return bounds; + bounds = _CGRectMakeCopy(bounds); bounds.origin.x += contentInset.left; bounds.origin.y += contentInset.top; bounds.size.width -= contentInset.left + contentInset.right; @@ -453,6 +454,7 @@ CPButtonImageOffset = 3.0; if (_CGInsetIsEmpty(bezelInset)) return bounds; + bounds = _CGRectMakeCopy(bounds); bounds.origin.x += bezelInset.left; bounds.origin.y += bezelInset.top; bounds.size.width -= bezelInset.left + bezelInset.right;