X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69342052a474bd322a57a9ed8c0d2858ebe2bac2..169d1d643c0ee0c90fa8e393b5298606bbb68cfd:/src/mac/carbon/renderer.cpp?ds=sidebyside diff --git a/src/mac/carbon/renderer.cpp b/src/mac/carbon/renderer.cpp index a739a49c57..62ff9846c9 100644 --- a/src/mac/carbon/renderer.cpp +++ b/src/mac/carbon/renderer.cpp @@ -135,12 +135,10 @@ wxRendererMac::DrawHeaderButton(wxWindow *win, const wxRect& rect, int flags) { - const int CORNER = 1; - - const wxCoord x = rect.x-1, - y = rect.y-1, - w = rect.width, - h = rect.height; + const wxCoord x = dc.XLOG2DEV(rect.x-1), + y = dc.YLOG2DEV(rect.y-1), + w = dc.XLOG2DEVREL(rect.width), + h = dc.YLOG2DEVREL(rect.height); int major,minor; wxGetOsVersion( &major, &minor ); @@ -164,13 +162,15 @@ wxRendererMac::DrawHeaderButton(wxWindow *win, { CGContextRef cgContext ; #if wxMAC_USE_CORE_GRAPHICS - cgContext = dynamic_cast(dc.GetGraphicContext())->GetNativeContext() ; + cgContext = ((wxMacCGContext*)(dc.GetGraphicContext()))->GetNativeContext() ; #else Rect bounds ; GetPortBounds( (CGrafPtr) dc.m_macPort , &bounds ) ; QDBeginCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ; CGContextTranslateCTM( cgContext , 0 , bounds.bottom - bounds.top ) ; CGContextScaleCTM( cgContext , 1 , -1 ) ; + HIShapeReplacePathInCGContext( HIShapeCreateWithQDRgn( (RgnHandle) dc.m_macCurrentClipRgn ) , cgContext ) ; + CGContextClip( cgContext ) ; HIViewConvertRect( &headerRect , (HIViewRef) win->GetHandle() , (HIViewRef) win->MacGetTopLevelWindow()->GetHandle() ) ; #endif { @@ -288,7 +288,7 @@ wxRendererMac::DrawSplitterSash(wxWindow *win, { CGContextRef cgContext ; #if wxMAC_USE_CORE_GRAPHICS - cgContext = dynamic_cast(dc.GetGraphicContext())->GetNativeContext() ; + cgContext = ((wxMacCGContext*)(dc.GetGraphicContext()))->GetNativeContext() ; #else Rect bounds ; GetPortBounds( (CGrafPtr) dc.m_macPort , &bounds ) ;