You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
465B

  1. #include "ui/List.hpp"
  2. namespace rack {
  3. namespace ui {
  4. void List::step() {
  5. widget::Widget::step();
  6. // Set positions of children
  7. box.size.y = 0.0;
  8. for (widget::Widget *child : children) {
  9. if (!child->visible)
  10. continue;
  11. // Increment height, set position of child
  12. child->box.pos = math::Vec(0.0, box.size.y);
  13. box.size.y += child->box.size.y;
  14. // Resize width of child
  15. child->box.size.x = box.size.x;
  16. }
  17. }
  18. } // namespace ui
  19. } // namespace rack