CPButton bezelRectForBounds and contentRectForBounds were modifying the bounds parameter in place without copying it.

This commit is contained in:
Aparajita Fishman
2010-09-30 17:27:06 -04:00
parent e527c7e19f
commit c3b5dc747a
+2
View File
@@ -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;