X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b129eaa3772fc5c73e6e95cd94010a828ebf42c3..eea4d01c65f9b29baa1193db762b4c6b8144af24:/src/common/graphcmn.cpp diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index 1ba501788f..8536a68762 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -534,7 +534,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxGraphicsContext, wxObject) wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) : wxGraphicsObject(renderer), m_antialias(wxANTIALIAS_DEFAULT), - m_composition(wxCOMPOSITION_OVER) + m_composition(wxCOMPOSITION_OVER), + m_enableOffset(false) { } @@ -564,6 +565,11 @@ void wxGraphicsContext::Flush() { } +void wxGraphicsContext::EnableOffset(bool enable) +{ + m_enableOffset = enable; +} + #if 0 void wxGraphicsContext::SetAlpha( wxDouble WXUNUSED(alpha) ) { @@ -589,7 +595,7 @@ void wxGraphicsContext::SetPen( const wxGraphicsPen& pen ) void wxGraphicsContext::SetPen( const wxPen& pen ) { - if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) + if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) SetPen( wxNullGraphicsPen ); else SetPen( CreatePen( pen ) ); @@ -603,7 +609,7 @@ void wxGraphicsContext::SetBrush( const wxGraphicsBrush& brush ) void wxGraphicsContext::SetBrush( const wxBrush& brush ) { - if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) + if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) SetBrush( wxNullGraphicsBrush ); else SetBrush( CreateBrush( brush ) ); @@ -617,7 +623,7 @@ void wxGraphicsContext::SetFont( const wxGraphicsFont& font ) void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour ) { - if ( font.Ok() ) + if ( font.IsOk() ) SetFont( CreateFont( font, colour ) ); else SetFont( wxNullGraphicsFont ); @@ -659,9 +665,7 @@ wxGraphicsContext::DoDrawFilledText(const wxString &str, // to make sure our 'OffsetToPixelBoundaries' doesn't move the fill shape SetPen( wxNullGraphicsPen ); - wxGraphicsPath path = CreatePath(); - path.AddRectangle( x , y, width, height ); - FillPath( path ); + DrawRectangle(x , y, width, height); DrawText( str, x ,y); SetBrush( formerBrush );