diff --git a/src/core/Blank.cpp b/src/core/Blank.cpp index a06ea074..10cd6c64 100644 --- a/src/core/Blank.cpp +++ b/src/core/Blank.cpp @@ -147,6 +147,11 @@ struct BlankWidget : ModuleWidget { bottomRightScrew = createWidget(Vec(box.size.x - 30, 365)); addChild(topRightScrew); addChild(bottomRightScrew); + + // Set box width from loaded Module before adding to the RackWidget, so modules aren't unnecessarily shoved around. + if (module) { + box.size.x = module->width * RACK_GRID_WIDTH; + } } void step() override { @@ -159,10 +164,12 @@ struct BlankWidget : ModuleWidget { topRightScrew->box.pos.x = box.size.x - 30; bottomRightScrew->box.pos.x = box.size.x - 30; if (box.size.x < RACK_GRID_WIDTH * 6) { - topRightScrew->visible = bottomRightScrew->visible = false; + topRightScrew->hide(); + bottomRightScrew->hide(); } else { - topRightScrew->visible = bottomRightScrew->visible = true; + topRightScrew->show(); + bottomRightScrew->show(); } rightHandle->box.pos.x = box.size.x - rightHandle->box.size.x; ModuleWidget::step();