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