aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMUILocalizerAndLayoutTweaker.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-06-24 18:30:10 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-06-24 18:30:10 +0000
commitcba40d9e2e1cc1d078e855b43f21c82bb0d7d275 (patch)
treeba66242172a2b86dd71abc7830250a95a58ea2f4 /AppKit/GTMUILocalizerAndLayoutTweaker.m
parent99e55aa47943ab0f18767fb906c96870c983715d (diff)
Ensure +[GTMUILocalizerAndLayoutTweaker sizeToFitFixedHeightTextField:] sets an integral size.
When resizing labels it's possible to get fractional sizes. This CL fixes the problem by using integral values. DELTA=17 (17 added, 0 deleted, 0 changed)
Diffstat (limited to 'AppKit/GTMUILocalizerAndLayoutTweaker.m')
-rw-r--r--AppKit/GTMUILocalizerAndLayoutTweaker.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.m b/AppKit/GTMUILocalizerAndLayoutTweaker.m
index 27a4649..d2ff80c 100644
--- a/AppKit/GTMUILocalizerAndLayoutTweaker.m
+++ b/AppKit/GTMUILocalizerAndLayoutTweaker.m
@@ -313,6 +313,9 @@ static const CGFloat kWrapperStringSlop = 0.9;
if (minWidth > fixedSize.width) {
finalSize.width = minWidth;
}
+ // Make integral.
+ finalSize.width = ceil(fixedSize.width);
+ finalSize.height = ceil(fixedSize.height);
if (!NSEqualSizes(fixedSize, finalSize)) {
[textField setFrameSize:finalSize];
}