diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index b05f1ea7df..16cbd185ba 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -239,11 +239,7 @@ private: wxCoord* externalLeading = NULL, const wxFont* theFont = NULL) const wxOVERRIDE; - virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE - { - DoSetClippingRegion(region.GetBox().x, region.GetBox().y, - region.GetBox().width, region.GetBox().height); - } + virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE; virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE; diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 6c6cdfd62b..96efcccc1c 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -1159,6 +1159,14 @@ void wxSVGFileDCImpl::DoGradientFillConcentric(const wxRect& rect, CalcBoundingBox(rect.x + rect.width, rect.y + rect.height); } +void wxSVGFileDCImpl::DoSetDeviceClippingRegion(const wxRegion& region) +{ + wxRect clipBox = region.GetBox(); + wxPoint logPos = DeviceToLogical(clipBox.x, clipBox.y); + wxSize logDim = DeviceToLogicalRel(clipBox.width, clipBox.height); + DoSetClippingRegion(logPos.x, logPos.y, logDim.x, logDim.y); +} + void wxSVGFileDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { // We need to have box definition in the standard form with (x,y)