| 1644 | |
| 1645 | |
| 1646 | void RackWidget::updateExpanders() { |
| 1647 | for (widget::Widget* w : internal->moduleContainer->children) { |
| 1648 | ModuleWidget* mw = (ModuleWidget*) w; |
| 1649 | |
| 1650 | math::Vec pLeft = mw->getGridBox().getTopLeft(); |
| 1651 | math::Vec pRight = mw->getGridBox().getTopRight(); |
| 1652 | ModuleWidget* mwLeft = NULL; |
| 1653 | ModuleWidget* mwRight = NULL; |
| 1654 | |
| 1655 | // Find adjacent modules |
| 1656 | for (widget::Widget* w2 : internal->moduleContainer->children) { |
| 1657 | ModuleWidget* mw2 = (ModuleWidget*) w2; |
| 1658 | if (mw2 == mw) |
| 1659 | continue; |
| 1660 | |
| 1661 | math::Vec p2Left = mw2->getGridBox().getTopLeft(); |
| 1662 | math::Vec p2Right = mw2->getGridBox().getTopRight(); |
| 1663 | |
| 1664 | // Check if this is a left module |
| 1665 | if (p2Right.equals(pLeft)) |
| 1666 | mwLeft = mw2; |
| 1667 | |
| 1668 | // Check if this is a right module |
| 1669 | if (p2Left.equals(pRight)) |
| 1670 | mwRight = mw2; |
| 1671 | } |
| 1672 | |
| 1673 | mw->module->leftExpander.moduleId = mwLeft ? mwLeft->module->id : -1; |
| 1674 | mw->module->rightExpander.moduleId = mwRight ? mwRight->module->id : -1; |
| 1675 | } |
| 1676 | } |
| 1677 | |
| 1678 | |
| 1679 | } // namespace app |
no test coverage detected