]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dcclient.cpp
Added wxRichTextTableBlock class to help with table UI operations
[wxWidgets.git] / src / osx / carbon / dcclient.cpp
index 97929e1093ce915b43497cd4c338fa6408e4c00e..e619f254046244578e39528c21d676c7330beb35 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     01/02/97
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -58,10 +57,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