X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e10972f6c1436a6dcd5427b4e3913bb0f398e045..ec2df34e27ba41f202ecbf096cdfed082a9ddb8f:/src/osx/carbon/graphics.cpp diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index c45b3f9066..c42ffba7f7 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1486,7 +1486,7 @@ public: // fast convenience methods - virtual void DrawRectangleX( wxDouble x, wxDouble y, wxDouble w, wxDouble h ); + virtual void DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ); void SetNativeContext( CGContextRef cg ); @@ -2706,11 +2706,21 @@ void * wxMacCoreGraphicsContext::GetNativeContext() } -void wxMacCoreGraphicsContext::DrawRectangleX( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) +void wxMacCoreGraphicsContext::DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) { + if (!EnsureIsValid()) + return; + if (m_composition == wxCOMPOSITION_DEST) return; + // when using shading, we have to go back to drawing paths + if ( !m_brush.IsNull() && ((wxMacCoreGraphicsBrushData*)m_brush.GetRefData())->IsShading() ) + { + wxGraphicsContext::DrawRectangle( x,y,w,h ); + return; + } + CGRect rect = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h ); if ( !m_brush.IsNull() ) {