Make use of FillRect() when possible.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -576,9 +576,22 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
wxCoord x2 = x + width;
|
wxCoord x2 = x + width;
|
||||||
wxCoord y2 = y + height;
|
wxCoord y2 = y + height;
|
||||||
|
|
||||||
|
if ((m_logicalFunction == wxCOPY) && (m_pen.GetStyle() == wxTRANSPARENT))
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
rect.left = XLOG2DEV(x);
|
||||||
|
rect.top = YLOG2DEV(y);
|
||||||
|
rect.right = XLOG2DEV(x2);
|
||||||
|
rect.bottom = YLOG2DEV(y2);
|
||||||
|
(void)FillRect(GetHdc(), &rect, m_brush.GetResourceHandle() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Windows draws the filled rectangles without outline (i.e. drawn with a
|
// Windows draws the filled rectangles without outline (i.e. drawn with a
|
||||||
// transparent pen) one pixel smaller in both directions and we want them
|
// transparent pen) one pixel smaller in both directions and we want them
|
||||||
// to have the same size regardless of which pen is used - adjust
|
// to have the same size regardless of which pen is used - adjust
|
||||||
|
|
||||||
|
// I wonder if this shouldn<64>t be done after the LOG2DEV() conversions. RR.
|
||||||
if ( m_pen.GetStyle() == wxTRANSPARENT )
|
if ( m_pen.GetStyle() == wxTRANSPARENT )
|
||||||
{
|
{
|
||||||
x2++;
|
x2++;
|
||||||
@@ -586,6 +599,8 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
(void)Rectangle(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
|
(void)Rectangle(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CalcBoundingBox(x, y);
|
CalcBoundingBox(x, y);
|
||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
|
|||||||
Reference in New Issue
Block a user