- if (!dc->Ok() )
- return FALSE;
-
- {
- wxMacPortSetter helper( dc ) ;
- PicHandle pict = GetHMETAFILE() ;
- DrawPicture( pict , &(**pict).picFrame ) ;
- }
- return TRUE;
-}
+ if (!dc->Ok())
+ return false;
+
+ {
+#if wxMAC_USE_CORE_GRAPHICS
+#ifndef __LP64__
+ QDPictRef cgPictRef = M_METAFILEDATA->m_qdPictRef;
+ CGContextRef cg = (CGContextRef) dc->GetGraphicsContext()->GetNativeContext();
+ CGRect bounds = QDPictGetBounds( cgPictRef );
+
+ CGContextSaveGState( cg );
+ CGContextTranslateCTM( cg, 0, bounds.size.width );
+ CGContextScaleCTM( cg, 1, -1 );
+ QDPictDrawToCGContext( cg, bounds, cgPictRef );
+ CGContextRestoreGState( cg );
+#endif
+#else
+ PicHandle pict = (PicHandle)GetHMETAFILE();
+ wxMacPortSetter helper( dc );
+ Rect picFrame;
+ DrawPicture( pict, wxMacGetPictureBounds( pict, &picFrame ) );
+#endif
+ }