From 9278c3e01c829c7036e220d2e113d7a7db482587 Mon Sep 17 00:00:00 2001 From: tellowkrinkle Date: Mon, 22 Jun 2020 17:43:42 -0500 Subject: [PATCH] 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 --- src/osx/cocoa/window.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index bf11057696..4b95b9669d 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -3448,8 +3448,8 @@ void wxWidgetCocoaImpl::GetBestRect( wxRect *r ) const [m_osxView sizeToFit]; NSRect best = [m_osxView frame]; [m_osxView setFrame:former]; - r->width = (int)best.size.width; - r->height = (int)best.size.height; + r->width = (int)ceil(best.size.width); + r->height = (int)ceil(best.size.height); } }