Fix retrieving clipping box after changing wxDC coordinates (GTK)
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also 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 by recalculating extents of the clipping region in new coordinates at nearest call to GetClippingBox(). Closes #17646.
This commit is contained in:
@@ -71,6 +71,7 @@ public:
|
||||
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const wxOVERRIDE;
|
||||
virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) wxOVERRIDE;
|
||||
virtual void DoSetDeviceClippingRegion( const wxRegion ®ion ) wxOVERRIDE;
|
||||
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const wxOVERRIDE;
|
||||
|
||||
virtual wxCoord GetCharWidth() const wxOVERRIDE;
|
||||
virtual wxCoord GetCharHeight() const wxOVERRIDE;
|
||||
@@ -110,6 +111,7 @@ public:
|
||||
bool m_isScreenDC;
|
||||
wxRegion m_currentClippingRegion;
|
||||
wxRegion m_paintClippingRegion;
|
||||
bool m_isClipBoxValid;
|
||||
|
||||
// PangoContext stuff for GTK 2.0
|
||||
PangoContext *m_context;
|
||||
@@ -123,6 +125,9 @@ public:
|
||||
|
||||
virtual GdkWindow *GetGDKWindow() const wxOVERRIDE { return m_gdkwindow; }
|
||||
|
||||
// Update the internal clip box variables
|
||||
void UpdateClipBox();
|
||||
|
||||
private:
|
||||
void DrawingSetup(GdkGC*& gc, bool& originChanged);
|
||||
GdkPixmap* MonoToColor(GdkPixmap* monoPixmap, int x, int y, int w, int h) const;
|
||||
|
Reference in New Issue
Block a user