X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ffa23cc5b1183802e8b3e0d2bed42ba097659d7..27d79a5027bee4f46e57c813d072422065cb1592:/src/osx/carbon/dcclient.cpp diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 97929e1093..bd3bd1ed75 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -58,10 +58,17 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) if ( cg == NULL ) { SetGraphicsContext( wxGraphicsContext::Create( window ) ) ; + m_contentScaleFactor = window->GetContentScaleFactor(); SetDeviceOrigin(-window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize()); } else { + // determine content scale + CGRect userrect = CGRectMake(0, 0, 10, 10); + CGRect devicerect; + devicerect = CGContextConvertRectToDeviceSpace(cg, userrect); + m_contentScaleFactor = devicerect.size.height / userrect.size.height; + CGContextSaveGState( cg ); m_release = true ; // make sure the context is having its origin at the wx-window coordinates of the