X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32cd189dfcfe96c41e32c3b9827bf67484c60b13..f518afb5dcd87eca4287a442e5cc78baf3ab9d4b:/src/mac/carbon/stattext.cpp diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 0898022392..21ed1ed771 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -91,6 +91,13 @@ wxSize wxStaticText::DoGetBestSize() const } else { +#if wxMAC_USE_CORE_GRAPHICS + wxClientDC dc(const_cast(this)); + wxCoord width, height ; + dc.GetTextExtent( m_label , &width, &height); + bounds.h = width; + bounds.v = height; +#else wxMacWindowStateSaver sv( this ); ::TextFont( m_font.MacGetFontNum() ); ::TextSize( (short)(m_font.MacGetFontSize()) ); @@ -100,6 +107,7 @@ wxSize wxStaticText::DoGetBestSize() const (!m_label.empty() ? (CFStringRef)str : CFSTR(" ")), kThemeCurrentPortFont, kThemeStateActive, false, &bounds, &baseline ); verify_noerr( err ); +#endif } if ( m_label.empty() )