]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dc.cpp
Minor compilo fix
[wxWidgets.git] / src / mac / carbon / dc.cpp
index da8c9f138bdf35f7ec7ca3a87d620ad76218f94a..e108c612102c7191e5b94d1b53229e1c9a679aa4 100644 (file)
@@ -107,13 +107,16 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) :
 
     if ( win )
     {
-        int x = 0 , y = 0;
-        win->MacWindowToRootWindow( &x,&y ) ;
-        // get area including focus rect
-        CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion(true).GetWXHRGN() , m_newClip ) ;
-        if ( !EmptyRgn( m_newClip ) )
-            OffsetRgn( m_newClip , x , y ) ;
-
+        // guard against half constructed objects, this just leads to a empty clip
+        if( win->GetPeer() )
+        {
+            int x = 0 , y = 0;
+            win->MacWindowToRootWindow( &x,&y ) ;
+            // get area including focus rect
+            CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion(true).GetWXHRGN() , m_newClip ) ;
+            if ( !EmptyRgn( m_newClip ) )
+                OffsetRgn( m_newClip , x , y ) ;
+        }
         SetClip( m_newClip ) ;
     }
 }
@@ -1340,6 +1343,10 @@ void  wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
         &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
 
     wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the rotated text") );
+
+    status = ::ATSUSetTransientFontMatching( atsuLayout , true ) ;
+    wxASSERT_MSG( status == noErr , wxT("couldn't setup transient font matching") );
+
     int iAngle = int( angle );
     int drawX = XLOG2DEVMAC(x) ;
     int drawY = YLOG2DEVMAC(y) ;