Round frame sizes up, not down in wxOSX

On Retina display macs, those values can contain halves.  If you round
them down, you end up cutting off content (e.g. cutting off the last
letter in a text label).

Closes https://github.com/wxWidgets/wxWidgets/pull/1905
This commit is contained in:
tellowkrinkle
2020-06-22 17:43:42 -05:00
committed by Vadim Zeitlin
parent 4ac648901d
commit 9278c3e01c

View File

@@ -3448,8 +3448,8 @@ void wxWidgetCocoaImpl::GetBestRect( wxRect *r ) const
[m_osxView sizeToFit]; [m_osxView sizeToFit];
NSRect best = [m_osxView frame]; NSRect best = [m_osxView frame];
[m_osxView setFrame:former]; [m_osxView setFrame:former];
r->width = (int)best.size.width; r->width = (int)ceil(best.size.width);
r->height = (int)best.size.height; r->height = (int)ceil(best.size.height);
} }
} }