]> git.saurik.com Git - wxWidgets.git/commitdiff
After calling sizeToFit, round the size up to the next integer
authorDavid Elliott <dfe@tgwbd.org>
Mon, 14 Jul 2003 18:59:05 +0000 (18:59 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Mon, 14 Jul 2003 18:59:05 +0000 (18:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/stattext.mm

index 31165040f4e9a81309d69c755ea7251be5cb3666..ff30c7cb2f1f82769e84de6a793b8a11720a0705 100644 (file)
@@ -16,6 +16,7 @@
 
 #import <Foundation/NSString.h>
 #import <AppKit/NSTextField.h>
+#include <math.h>
 
 IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
 BEGIN_EVENT_TABLE(wxStaticText, wxControl)
@@ -40,7 +41,13 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID winid,
     [GetNSTextField() setBezeled: NO];
     [GetNSTextField() setEditable: NO];
     [GetNSTextField() setDrawsBackground: NO];
+
     [GetNSControl() sizeToFit];
+    // Round-up to next integer size
+    NSRect nsrect = [m_cocoaNSView frame];
+    nsrect.size.width = ceil(nsrect.size.width);
+    [m_cocoaNSView setFrameSize: nsrect.size];
+
     if(m_parent)
         m_parent->CocoaAddChild(this);
     return true;