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
This commit is contained in:
Guillermo Rodriguez Garcia
2000-02-15 18:06:56 +00:00
parent fb65642cd4
commit dfde8cd357

View 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 // to have the same size regardless of which pen is used - adjust
if ( m_pen.GetStyle() == wxTRANSPARENT ) if ( m_pen.GetStyle() == wxTRANSPARENT )
{ {
// x2++; x2++;
// y2++; y2++;
} }
(void)Rectangle(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(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 x2 = (x+width);
wxCoord y2 = (y+height); 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), (void)RoundRect(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2),
YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius))); YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius)));