From ee3daf49d0385f9892509a535e98de59a526ef98 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 5 Aug 2023 19:05:37 -0400 Subject: [PATCH] Don't dispatch ChangeEvent in app::Svg* setters, since setters can be called from constructors and events are virtual. --- src/app/SvgKnob.cpp | 4 ---- src/app/SvgSlider.cpp | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/src/app/SvgKnob.cpp b/src/app/SvgKnob.cpp index c72caca5..6a2a467c 100644 --- a/src/app/SvgKnob.cpp +++ b/src/app/SvgKnob.cpp @@ -35,10 +35,6 @@ void SvgKnob::setSvg(std::shared_ptr svg) { // shadow->box = shadow->box.grow(math::Vec(2, 2)); fb->setDirty(); - - // Dispatch ChangeEvent - ChangeEvent eChange; - onChange(eChange); } void SvgKnob::onChange(const ChangeEvent& e) { diff --git a/src/app/SvgSlider.cpp b/src/app/SvgSlider.cpp index 56073471..e44bcf1c 100644 --- a/src/app/SvgSlider.cpp +++ b/src/app/SvgSlider.cpp @@ -27,10 +27,6 @@ void SvgSlider::setBackgroundSvg(std::shared_ptr svg) { box.size = background->box.size; fb->box.size = background->box.size; fb->setDirty(); - - // Dispatch ChangeEvent - ChangeEvent eChange; - onChange(eChange); } @@ -41,20 +37,12 @@ void SvgSlider::setHandleSvg(std::shared_ptr svg) { handle->setSvg(svg); handle->box.pos = minHandlePos; fb->setDirty(); - - // Dispatch ChangeEvent - ChangeEvent eChange; - onChange(eChange); } void SvgSlider::setHandlePos(math::Vec minHandlePos, math::Vec maxHandlePos) { this->minHandlePos = minHandlePos; this->maxHandlePos = maxHandlePos; - - // Dispatch ChangeEvent - ChangeEvent eChange; - onChange(eChange); }