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
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <AppKit/NSTextField.h>
|
#import <AppKit/NSTextField.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
|
||||||
BEGIN_EVENT_TABLE(wxStaticText, wxControl)
|
BEGIN_EVENT_TABLE(wxStaticText, wxControl)
|
||||||
@@ -40,7 +41,13 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
[GetNSTextField() setBezeled: NO];
|
[GetNSTextField() setBezeled: NO];
|
||||||
[GetNSTextField() setEditable: NO];
|
[GetNSTextField() setEditable: NO];
|
||||||
[GetNSTextField() setDrawsBackground: NO];
|
[GetNSTextField() setDrawsBackground: NO];
|
||||||
|
|
||||||
[GetNSControl() sizeToFit];
|
[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)
|
if(m_parent)
|
||||||
m_parent->CocoaAddChild(this);
|
m_parent->CocoaAddChild(this);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user