fixed clip rect when logical coords != device ones
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -276,12 +276,16 @@ void wxDC::SelectOldObjects(WXHDC dc)
|
||||
m_clipY2 = (wxCoord) YDEV2LOG(rect.bottom); \
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
|
||||
void wxDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
|
||||
{
|
||||
m_clipping = TRUE;
|
||||
|
||||
HRGN hrgn = ::CreateRectRgn(XLOG2DEV(cx), YLOG2DEV(cy),
|
||||
XLOG2DEV(cx + cw), YLOG2DEV(cy + ch));
|
||||
// the region coords are always the device ones, so do the translation
|
||||
// manually
|
||||
HRGN hrgn = ::CreateRectRgn(LogicalToDeviceX(x),
|
||||
LogicalToDeviceY(y),
|
||||
LogicalToDeviceX(x + w),
|
||||
LogicalToDeviceY(y + h));
|
||||
if ( !hrgn )
|
||||
{
|
||||
wxLogLastError(_T("CreateRectRgn"));
|
||||
|
Reference in New Issue
Block a user