X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb4083ef0b3abab6cb4b4ca33f9aa1ea58e1f5c9..c782096417f0fd9de6c6d47b23174233ec6bcf57:/src/msw/graphics.cpp diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 142c2f60e8..bda43979a7 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -303,6 +303,7 @@ public: virtual void GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height, wxDouble *descent, wxDouble *externalLeading ) const; virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const; + virtual bool ShouldOffset() const; private: void Init(); @@ -1185,6 +1186,18 @@ void wxGDIPlusContext::GetPartialTextExtents(const wxString& text, wxArrayDouble } } +bool wxGDIPlusContext::ShouldOffset() const +{ + int penwidth = 0 ; + if ( !m_pen.IsNull() ) + { + penwidth = (int)((wxGDIPlusPenData*)m_pen.GetRefData())->GetWidth(); + if ( penwidth == 0 ) + penwidth = 1; + } + return ( penwidth % 2 ) == 1; +} + void* wxGDIPlusContext::GetNativeContext() { return m_context;