| 656 | } |
| 657 | |
| 658 | void RackWidget::addModule(ModuleWidget* m) { |
| 659 | assert(m); |
| 660 | |
| 661 | // Module must be 3U high and at least 1HP wide |
| 662 | if (m->box.size.x < RACK_GRID_WIDTH / 2) |
| 663 | throw Exception("Module %s width is %g px, must be at least %g px", m->model->getFullName().c_str(), m->box.size.x, RACK_GRID_WIDTH); |
| 664 | |
| 665 | if (m->box.size.y != RACK_GRID_HEIGHT) |
| 666 | throw Exception("Module %s height is %g px, must be %g px", m->model->getFullName().c_str(), m->box.size.y, RACK_GRID_HEIGHT); |
| 667 | |
| 668 | internal->moduleContainer->addChild(m); |
| 669 | |
| 670 | updateExpanders(); |
| 671 | } |
| 672 | |
| 673 | void RackWidget::addModuleAtMouse(ModuleWidget* mw) { |
| 674 | assert(mw); |
no test coverage detected