From: David Elliott Date: Mon, 14 Jul 2003 18:59:05 +0000 (+0000) Subject: After calling sizeToFit, round the size up to the next integer X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1c54c79268ff605780cad4f13a6af9643ef0559a After calling sizeToFit, round the size up to the next integer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/cocoa/stattext.mm b/src/cocoa/stattext.mm index 31165040f4..ff30c7cb2f 100644 --- a/src/cocoa/stattext.mm +++ b/src/cocoa/stattext.mm @@ -16,6 +16,7 @@ #import #import +#include 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;