Browse Source

Use old module move algorithm for adding/removing modules when auto-squeeze is disabled.

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

+ 6
- 2
src/app/ModuleWidget.cpp View File

@@ -840,7 +840,10 @@ void ModuleWidget::cloneAction(bool cloneCables) {
// Place module to the right of `this` module, by forcing it to 1 HP to the right.
math::Vec clonedPos = box.pos;
clonedPos.x += clonedModuleWidget->box.getWidth();
APP->scene->rack->squeezeModulePos(clonedModuleWidget, clonedPos);
if (settings::squeezeModules)
APP->scene->rack->squeezeModulePos(clonedModuleWidget, clonedPos);
else
APP->scene->rack->setModulePosNearest(clonedModuleWidget, clonedPos);
h->push(APP->scene->rack->getModuleDragAction());

// history::ModuleAdd
@@ -903,7 +906,8 @@ void ModuleWidget::removeAction() {

// Unset module position from rack.
APP->scene->rack->updateModuleOldPositions();
APP->scene->rack->unsqueezeModulePos(this);
if (settings::squeezeModules)
APP->scene->rack->unsqueezeModulePos(this);
h->push(APP->scene->rack->getModuleDragAction());

// history::ModuleRemove


+ 1
- 1
src/app/RackWidget.cpp View File

@@ -339,7 +339,7 @@ void RackWidget::fromJson(json_t* rootJ) {
pos = pos.mult(RACK_GRID_SIZE);
}
pos = pos.plus(RACK_OFFSET);
squeezeModulePos(mw, pos);
setModulePosForce(mw, pos);

internal->moduleContainer->addChild(mw);
}


Loading…
Cancel
Save