workaround for MGL's weirdness: won't render rectangles of w=1 or h=1

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2002-01-26 00:24:16 +00:00
parent 69830d1f58
commit 497b78dfac

View File

@ -557,8 +557,16 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
if ( !m_penSelected )
SelectPen();
m_MGLDC->rect(xx + m_penOfsX, yy + m_penOfsY,
xx + ww + m_penOfsX, yy + hh + m_penOfsY);
// VS: MGLDC::rect() does not render rectangles that have width
// or height equal to 1, so we have to use MGLDC::line()
// instead...
if ( hh == 1 || ww == 1 )
m_MGLDC->line(xx + m_penOfsX, yy + m_penOfsY,
xx + ww-1 + m_penOfsX, yy + hh-1 + m_penOfsY);
else
m_MGLDC->rect(xx + m_penOfsX, yy + m_penOfsY,
xx + ww + m_penOfsX, yy + hh + m_penOfsY);
}
CalcBoundingBox(x, y);