]> git.saurik.com Git - wxWidgets.git/commitdiff
Readded fix to adjust size of rectangles with transparent outline
authorGuillermo Rodriguez Garcia <guille@iies.es>
Tue, 15 Feb 2000 18:06:56 +0000 (18:06 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Tue, 15 Feb 2000 18:06:56 +0000 (18:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dc.cpp

index 5190c3b350d466a5c902f0096eb7bdf41c3ebf29..c6bd96b07331b62f3699491f0649220735b5c04a 100644 (file)
@@ -547,8 +547,8 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
     // to have the same size regardless of which pen is used - adjust
     if ( m_pen.GetStyle() == wxTRANSPARENT )
     {
-//        x2++;
-//        y2++;
+        x2++;
+        y2++;
     }
 
     (void)Rectangle(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
@@ -583,6 +583,15 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord h
     wxCoord x2 = (x+width);
     wxCoord y2 = (y+height);
 
+    // Windows draws the filled rectangles without outline (i.e. drawn with a
+    // transparent pen) one pixel smaller in both directions and we want them
+    // to have the same size regardless of which pen is used - adjust
+    if ( m_pen.GetStyle() == wxTRANSPARENT )
+    {
+        x2++;
+        y2++;
+    }
+
     (void)RoundRect(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2),
         YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius)));