supporting native content scaling on OSX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,10 +58,17 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window )
|
|||||||
if ( cg == NULL )
|
if ( cg == NULL )
|
||||||
{
|
{
|
||||||
SetGraphicsContext( wxGraphicsContext::Create( window ) ) ;
|
SetGraphicsContext( wxGraphicsContext::Create( window ) ) ;
|
||||||
|
m_contentScaleFactor = window->GetContentScaleFactor();
|
||||||
SetDeviceOrigin(-window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize());
|
SetDeviceOrigin(-window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize());
|
||||||
}
|
}
|
||||||
else
|
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 );
|
CGContextSaveGState( cg );
|
||||||
m_release = true ;
|
m_release = true ;
|
||||||
// make sure the context is having its origin at the wx-window coordinates of the
|
// make sure the context is having its origin at the wx-window coordinates of the
|
||||||
|
Reference in New Issue
Block a user