Browse Source

Fix expanders occasionally not connecting when removing a module.

tags/v2.1.2
Andrew Belt 2 years ago
parent
commit
d3e6c84fc3
2 changed files with 5 additions and 5 deletions
  1. +3
    -0
      src/app/ModuleWidget.cpp
  2. +2
    -5
      src/app/RackWidget.cpp

+ 3
- 0
src/app/ModuleWidget.cpp View File

@@ -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();
}




+ 2
- 5
src/app/RackWidget.cpp View File

@@ -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() {


Loading…
Cancel
Save