X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca77701441e39245dcbfce903049e76f166979e5..ec2df34e27ba41f202ecbf096cdfed082a9ddb8f:/src/osx/carbon/graphics.cpp diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 7dd6911483..c42ffba7f7 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -2708,9 +2708,19 @@ void * wxMacCoreGraphicsContext::GetNativeContext() 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() ) {