X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ee4c7b948e76377a6947d3ffbe5099870d0c3e9..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/common/graphcmn.cpp diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index b014460e0b..8536a68762 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -520,7 +520,7 @@ void wxGraphicsGradientStops::Add(const wxGraphicsGradientStop& stop) } else { - wxFAIL_MSG( "invalid gradient stop position >= 1" ); + wxFAIL_MSG( "invalid gradient stop position > 1" ); } } @@ -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) ) { @@ -575,12 +581,6 @@ wxDouble wxGraphicsContext::GetAlpha() const } #endif -void wxGraphicsContext::GetSize( wxDouble* width, wxDouble* height) -{ - *width = 10000.0; - *height = 10000.0; -} - void wxGraphicsContext::GetDPI( wxDouble* dpiX, wxDouble* dpiY) { *dpiX = 72.0; @@ -595,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 ) ); @@ -609,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 ) ); @@ -623,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 ); @@ -665,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 ); @@ -872,6 +870,15 @@ wxGraphicsBitmap wxGraphicsContext::CreateSubBitmap( const wxGraphicsBitmap &bmp } #endif +#ifdef __WXMSW__ +#if wxUSE_ENH_METAFILE +/* static */ wxGraphicsContext* wxGraphicsContext::Create( const wxEnhMetaFileDC& dc) +{ + return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc); +} +#endif +#endif + wxGraphicsContext* wxGraphicsContext::CreateFromNative( void * context ) { return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromNativeContext(context);