Fix SetDeviceClippingRegion for wxSVGFileDC
Device-based coordinates should be converted to logical coordinates before they are passed to SetClippingRegion().
This commit is contained in:
@@ -239,11 +239,7 @@ private:
|
|||||||
wxCoord* externalLeading = NULL,
|
wxCoord* externalLeading = NULL,
|
||||||
const wxFont* theFont = NULL) const wxOVERRIDE;
|
const wxFont* theFont = NULL) const wxOVERRIDE;
|
||||||
|
|
||||||
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE
|
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE;
|
||||||
{
|
|
||||||
DoSetClippingRegion(region.GetBox().x, region.GetBox().y,
|
|
||||||
region.GetBox().width, region.GetBox().height);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
|
||||||
wxCoord w, wxCoord h) wxOVERRIDE;
|
wxCoord w, wxCoord h) wxOVERRIDE;
|
||||||
|
@@ -1159,6 +1159,14 @@ void wxSVGFileDCImpl::DoGradientFillConcentric(const wxRect& rect,
|
|||||||
CalcBoundingBox(rect.x + rect.width, rect.y + rect.height);
|
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)
|
void wxSVGFileDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||||
{
|
{
|
||||||
// We need to have box definition in the standard form with (x,y)
|
// We need to have box definition in the standard form with (x,y)
|
||||||
|
Reference in New Issue
Block a user