]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix the rectangle size when offsetting
authorRobin Dunn <robin@alldunn.com>
Wed, 25 Oct 2006 06:55:49 +0000 (06:55 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 25 Oct 2006 06:55:49 +0000 (06:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/graphcmn.cpp

index f921072da7f4ee7e07fb183468f8a1f6a607d1be..6fbcba80675ee0086bc7845b3eaff4c4b681dbd7 100644 (file)
@@ -992,6 +992,13 @@ void wxGCDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height
         hh = -hh;
         yy = yy - hh;
     }
+    if ( m_graphicContext->ShouldOffset() )
+    {
+        // if we are offsetting the entire rectangle is moved 0.5, so the
+        // border line gets off by 1
+        ww -= 1;
+        hh -= 1;
+    }
     m_graphicContext->DrawRectangle( xx,yy,ww,hh);
 }