Browse Source

Set ModuleWidget width to 12HP if SVG panel has zero width.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
319ece9430
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/app/ModuleWidget.cpp

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

@@ -95,6 +95,9 @@ void ModuleWidget::setPanel(widget::Widget* panel) {
addChildBottom(panel); addChildBottom(panel);
internal->panel = panel; internal->panel = panel;
box.size.x = std::round(panel->box.size.x / RACK_GRID_WIDTH) * RACK_GRID_WIDTH; box.size.x = std::round(panel->box.size.x / RACK_GRID_WIDTH) * RACK_GRID_WIDTH;
// If width is zero, set it to 12HP for sanity
if (box.size.x == 0.0)
box.size.x = 12 * RACK_GRID_WIDTH;
} }
} }




Loading…
Cancel
Save