X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29188693b3b8ba4b07762df012cc652d421dae79..9c805dec6caf3c98a3797898cffe795b5b56e606:/include/wx/graphics.h diff --git a/include/wx/graphics.h b/include/wx/graphics.h index 4a2b42c974..b79ba6144c 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -503,7 +503,13 @@ public: virtual bool SetCompositionMode(wxCompositionMode op) = 0; // returns the size of the graphics context in device coordinates - virtual void GetSize( wxDouble* width, wxDouble* height); + void GetSize(wxDouble* width, wxDouble* height) + { + if ( width ) + *width = m_width; + if ( height ) + *height = m_height; + } // returns the resolution of the graphics context in device points per inch virtual void GetDPI( wxDouble* dpiX, wxDouble* dpiY); @@ -636,14 +642,25 @@ public: // helper to determine if a 0.5 offset should be applied for the drawing operation virtual bool ShouldOffset() const { return false; } - + + // indicates whether the context should try to offset for pixel boundaries, this only makes sense on + // bitmap devices like screen, by default this is turned off + virtual void EnableOffset(bool enable = true); + + void DisableOffset() { EnableOffset(false); } + bool OffsetEnabled() { return m_enableOffset; } + protected: + // These fields must be initialized in the derived class ctors. + wxDouble m_width, + m_height; wxGraphicsPen m_pen; wxGraphicsBrush m_brush; wxGraphicsFont m_font; wxAntialiasMode m_antialias; wxCompositionMode m_composition; + bool m_enableOffset; protected: // implementations of overloaded public functions: we use different names