Browse Source

Assert ModuleWidget height when added to RackWidget. Round ModuleWidget width to nearest HP.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
bd65799a43
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      src/app/ModuleWidget.cpp
  2. +1
    -0
      src/app/RackWidget.cpp

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

@@ -393,7 +393,7 @@ void ModuleWidget::setPanel(std::shared_ptr<Svg> svg) {
SvgPanel *svgPanel = new SvgPanel;
svgPanel->setBackground(svg);
addChild(svgPanel);
box.size.x = svgPanel->box.size.x;
box.size.x = std::round(svgPanel->box.size.x / RACK_GRID_WIDTH) * RACK_GRID_WIDTH;
panel = svgPanel;
}



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

@@ -350,6 +350,7 @@ static void RackWidget_updateAdjacent(RackWidget *that) {
void RackWidget::addModule(ModuleWidget *m) {
// Add module to ModuleContainer
assert(m);
assert(m->box.size.y == RACK_GRID_HEIGHT);
moduleContainer->addChild(m);

if (m->module) {


Loading…
Cancel
Save