From d3e6c84fc30d8620dc39417621b74de484e2a7d0 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 29 Jun 2022 22:21:13 -0400 Subject: [PATCH] Fix expanders occasionally not connecting when removing a module. --- src/app/ModuleWidget.cpp | 3 +++ src/app/RackWidget.cpp | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index 88738333..533732d5 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -845,6 +845,7 @@ void ModuleWidget::cloneAction(bool cloneCables) { else APP->scene->rack->setModulePosNearest(clonedModuleWidget, clonedPos); h->push(APP->scene->rack->getModuleDragAction()); + APP->scene->rack->updateExpanders(); // history::ModuleAdd history::ModuleAdd* hma = new history::ModuleAdd; @@ -920,6 +921,8 @@ void ModuleWidget::removeAction() { // This removes the module and transfers ownership to caller APP->scene->rack->removeModule(this); delete this; + + APP->scene->rack->updateExpanders(); } diff --git a/src/app/RackWidget.cpp b/src/app/RackWidget.cpp index a5ffd08e..d92c160e 100644 --- a/src/app/RackWidget.cpp +++ b/src/app/RackWidget.cpp @@ -764,7 +764,8 @@ void RackWidget::setModulePosSqueeze(ModuleWidget* mw, math::Vec pos) { unsqueezeModulePos(mw); squeezeModulePos(mw, pos); - // updateExpanders() called above twice + + updateExpanders(); } void RackWidget::squeezeModulePos(ModuleWidget* mw, math::Vec pos) { @@ -819,8 +820,6 @@ void RackWidget::squeezeModulePos(ModuleWidget* mw, math::Vec pos) { // Commit new pos mw->setGridPosition(mwBox.pos); - - updateExpanders(); } void RackWidget::unsqueezeModulePos(ModuleWidget* mw) { @@ -864,8 +863,6 @@ void RackWidget::unsqueezeModulePos(ModuleWidget* mw) { xLeft = mw2->getGridBox().getRight(); } } - - updateExpanders(); } void RackWidget::updateModuleOldPositions() {