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.

25 lines
416B

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