Add missing bounding box calculations in wxMSW wxDC code.

Update the bounding box when drawing bitmaps (in one of several possible ways)
and gradients.

Closes #2132.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-02-17 23:53:38 +00:00
parent fd743aad4b
commit b577f3d731

View File

@ -1319,7 +1319,11 @@ void wxMSWDCImpl::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool
SelectInHDC select(hdcMem, GetHbitmapOf(bmp));
if ( AlphaBlt(this, x, y, width, height, 0, 0, width, height, hdcMem, bmp) )
{
CalcBoundingBox(x, y);
CalcBoundingBox(x + bmp.GetWidth(), y + bmp.GetHeight());
return;
}
}
SET_STRETCH_BLT_MODE(GetHdc());
@ -1426,6 +1430,9 @@ void wxMSWDCImpl::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool
::SelectObject( memdc, hOldBitmap );
::DeleteDC( memdc );
}
CalcBoundingBox(x, y);
CalcBoundingBox(x + bmp.GetWidth(), y + bmp.GetHeight());
}
void wxMSWDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
@ -2209,7 +2216,11 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
{
if ( AlphaBlt(this, xdest, ydest, dstWidth, dstHeight,
xsrc, ysrc, srcWidth, srcHeight, hdcSrc, bmpSrc) )
{
CalcBoundingBox(xdest, ydest);
CalcBoundingBox(xdest + dstWidth, ydest + dstHeight);
return true;
}
}
wxMask *mask = NULL;
@ -2486,6 +2497,12 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
}
}
if ( success )
{
CalcBoundingBox(xdest, ydest);
CalcBoundingBox(xdest + dstWidth, ydest + dstHeight);
}
return success;
}
@ -2911,6 +2928,8 @@ void wxMSWDCImpl::DoGradientFillLinear (const wxRect& rect,
) )
{
// skip call of the base class version below
CalcBoundingBox(rect.GetLeft(), rect.GetBottom());
CalcBoundingBox(rect.GetRight(), rect.GetTop());
return;
}