From b1206a6d50e9bea1e02d61dda6299d8d474bdf27 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 26 Jul 2021 20:30:57 +0200 Subject: [PATCH] Fix inserting new SVG element New container element should be created every time the actual transformation is changed and that's why the flag should be set in ComputeScaleAndOrigin(). --- include/wx/dcsvg.h | 18 +----------------- src/common/dcsvg.cpp | 5 +++++ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 138ecd4eac..b05f1ea7df 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -127,23 +127,7 @@ public: return wxCOPY; } - virtual void SetLogicalOrigin(wxCoord x, wxCoord y) wxOVERRIDE - { - wxDCImpl::SetLogicalOrigin(x, y); - m_graphics_changed = true; - } - - virtual void SetDeviceOrigin(wxCoord x, wxCoord y) wxOVERRIDE - { - wxDCImpl::SetDeviceOrigin(x, y); - m_graphics_changed = true; - } - - virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) wxOVERRIDE - { - wxDCImpl::SetAxisOrientation(xLeftRight, yBottomUp); - m_graphics_changed = true; - } + virtual void ComputeScaleAndOrigin() wxOVERRIDE; virtual void SetBackground(const wxBrush& brush) wxOVERRIDE; virtual void SetBackgroundMode(int mode) wxOVERRIDE; diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 1a75f54c30..6c6cdfd62b 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -1263,6 +1263,11 @@ wxCoord wxSVGFileDCImpl::GetCharWidth() const return sDC.GetCharWidth(); } +void wxSVGFileDCImpl::ComputeScaleAndOrigin() +{ + wxDCImpl::ComputeScaleAndOrigin(); + m_graphics_changed = true; +} // ---------------------------------------------------------- // wxSVGFileDCImpl - set functions