Browse Source

Fix #1479

tags/v1.1.4
Andrew Belt 4 years ago
parent
commit
f55d039ee9
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/app/RackWidget.cpp

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

@@ -534,7 +534,12 @@ history::ComplexAction* RackWidget::getModuleDragAction() {
for (widget::Widget* w : moduleContainer->children) {
ModuleWidget* mw = dynamic_cast<ModuleWidget*>(w);
assert(mw);
math::Vec pos = moduleDragPositions.at(mw->module->id);
// It is possible to add modules to the rack while dragging, so ignore modules that don't exist.
auto it = moduleDragPositions.find(mw->module->id);
if (it == moduleDragPositions.end())
continue;
// Create ModuleMove action if the module was moved.
math::Vec pos = it->second;
if (!pos.isEqual(mw->box.pos)) {
history::ModuleMove* mmh = new history::ModuleMove;
mmh->moduleId = mw->module->id;


Loading…
Cancel
Save