]> git.saurik.com Git - wxWidgets.git/commitdiff
supprting flag for pixel offsetting for msw, see #11853
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 16 Apr 2011 13:07:11 +0000 (13:07 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 16 Apr 2011 13:07:11 +0000 (13:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/graphics.cpp

index 05a385d90b3efe9bdeefe5894e55821af7b97a1e..4e852ada989db25384b959d30c771224dbdcc4e7 100644 (file)
@@ -1298,6 +1298,7 @@ wxGDIPlusContext::wxGDIPlusContext( wxGraphicsRenderer* renderer, HWND hwnd  )
     : wxGraphicsContext(renderer)
 {
     Init();
+    m_enableOffset = true;
     m_context = new Graphics( hwnd);
     RECT rect = wxGetWindowRect(hwnd);
     m_width = rect.right - rect.left;
@@ -1771,6 +1772,9 @@ void wxGDIPlusContext::GetPartialTextExtents(const wxString& text, wxArrayDouble
 
 bool wxGDIPlusContext::ShouldOffset() const
 {
+    if ( !m_enableOffset )
+        return false;
+    
     int penwidth = 0 ;
     if ( !m_pen.IsNull() )
     {
@@ -1900,7 +1904,9 @@ void wxGDIPlusRenderer::Unload()
 wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxWindowDC& dc)
 {
     ENSURE_LOADED_OR_RETURN(NULL);
-    return new wxGDIPlusContext(this, dc);
+    wxGDIPlusContext* context = new wxGDIPlusContext(this, dc);
+    context->EnableOffset(true);
+    return context;
 }
 
 #if wxUSE_PRINTING_ARCHITECTURE
@@ -1924,7 +1930,9 @@ wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxEnhMetaFileDC& dc)
 wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxMemoryDC& dc)
 {
     ENSURE_LOADED_OR_RETURN(NULL);
-    return new wxGDIPlusContext(this, dc);
+    wxGDIPlusContext* context = new wxGDIPlusContext(this, dc);
+    context->EnableOffset(true);
+    return context;
 }
 
 wxGraphicsContext * wxGDIPlusRenderer::CreateMeasuringContext()