Fix retrieving clipping box after changing wxDC coordinates (MSW)
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing HDC is associated with wxDC using SetHDC() or when wxDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale(), SetLogicalScale(), SetTransformMatrix() or ResetTransformMatrix(). When any of these functions is called then clipping box data are marked as invalid and updated using GetClipBox() Win API at nearest call to GetClippingBox(). See #17646.
This commit is contained in:
@@ -121,8 +121,7 @@ public:
|
||||
// return it if asked -- but avoid calling ::GetClipBox() right now as
|
||||
// it could be unnecessary wasteful
|
||||
m_clipping = true;
|
||||
m_clipX1 =
|
||||
m_clipX2 = 0;
|
||||
m_isClipBoxValid = false;
|
||||
}
|
||||
|
||||
void* GetHandle() const { return (void*)GetHDC(); }
|
||||
@@ -164,6 +163,7 @@ protected:
|
||||
#if wxUSE_PALETTE
|
||||
m_oldPalette = NULL;
|
||||
#endif // wxUSE_PALETTE
|
||||
m_isClipBoxValid = false;
|
||||
}
|
||||
|
||||
// create an uninitialized DC: this should be only used by the derived
|
||||
@@ -323,6 +323,8 @@ protected:
|
||||
static wxObjectList sm_dcCache;
|
||||
#endif
|
||||
|
||||
bool m_isClipBoxValid;
|
||||
|
||||
wxDECLARE_CLASS(wxMSWDCImpl);
|
||||
wxDECLARE_NO_COPY_CLASS(wxMSWDCImpl);
|
||||
};
|
||||
|
Reference in New Issue
Block a user