From: Guillermo Rodriguez Garcia Date: Tue, 15 Feb 2000 18:06:56 +0000 (+0000) Subject: Readded fix to adjust size of rectangles with transparent outline X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dfde8cd35734463150078a804475402d48e4c241 Readded fix to adjust size of rectangles with transparent outline git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 5190c3b350..c6bd96b073 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -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)));