From 367efe590e95f398556ff87dbf9c09a81335f79a Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sat, 17 Jul 2010 12:17:35 -0400 Subject: [PATCH] Fixed with the new string size optimisation: the cache value was returned by reference and something in the CPButton path for image and text buttons changed it causing text to become misaligned. A defensive copy avoids this problem. --- AppKit/CPStringDrawing.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPStringDrawing.j b/AppKit/CPStringDrawing.j index fbd174592..68eea2803 100644 --- a/AppKit/CPStringDrawing.j +++ b/AppKit/CPStringDrawing.j @@ -60,7 +60,7 @@ var CPStringSizeWithFontInWidthCache = {}; CPStringSizeWithFontInWidthCache[cacheKey] = size; } - return size; + return CGSizeMakeCopy(size); }