Browse Source

Fix ModuleWidget::cloneAction() position of cloned module.

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

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

@@ -829,9 +829,9 @@ void ModuleWidget::cloneAction(bool cloneCables) {
APP->scene->rack->updateModuleOldPositions();
APP->scene->rack->addModule(clonedModuleWidget);
// Place module to the right of `this` module, by forcing it to 1 HP to the right.
math::Vec clonedPos = box.pos + math::Vec(RACK_GRID_WIDTH, 0);
clonedModuleWidget->box.pos = clonedPos;
APP->scene->rack->setModulePosForce(clonedModuleWidget, clonedPos);
math::Vec clonedPos = box.pos;
clonedPos.x += clonedModuleWidget->box.getWidth();
APP->scene->rack->forceSetModulePos(clonedModuleWidget, clonedPos);
h->push(APP->scene->rack->getModuleDragAction());

// history::ModuleAdd


Loading…
Cancel
Save