Make wxSVGFileDC::GetClippingBox() actually work
wxSVGFileDCImpl class uses the default, i.e. inherited from wxDCImpl, implementation of this method, but for it to work, the clipping box coordinates stored in wxDCImpl need to be updated when the clipping region changes or is destroyed and this wasn't done before. Fix this now and add a unit test verifying that this indeed works.
This commit is contained in:
@@ -934,6 +934,9 @@ void wxSVGFileDCImpl::DoSetClippingRegion(int x, int y, int width, int height)
|
||||
|
||||
m_clipUniqueId++;
|
||||
m_clipNestingLevel++;
|
||||
|
||||
// Update the base class m_clip[XY][12] fields too.
|
||||
wxDCImpl::DoSetClippingRegion(x, y, width, height);
|
||||
}
|
||||
|
||||
void wxSVGFileDCImpl::DestroyClippingRegion()
|
||||
@@ -958,6 +961,9 @@ void wxSVGFileDCImpl::DestroyClippingRegion()
|
||||
DoStartNewGraphics();
|
||||
|
||||
m_clipUniqueId = 0;
|
||||
|
||||
// Also update the base class clipping region information.
|
||||
wxDCImpl::DestroyClippingRegion();
|
||||
}
|
||||
|
||||
void wxSVGFileDCImpl::DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h, wxCoord *descent, wxCoord *externalLeading, const wxFont *font) const
|
||||
|
Reference in New Issue
Block a user