| 5 | namespace recompui { |
| 6 | |
| 7 | ScrollContainer::ScrollContainer(Element *parent, ScrollDirection direction) : Element(parent) { |
| 8 | set_flex(1.0f, 1.0f, 100.0f); |
| 9 | set_width(100.0f, Unit::Percent); |
| 10 | set_height(100.0f, Unit::Percent); |
| 11 | |
| 12 | switch (direction) { |
| 13 | case ScrollDirection::Horizontal: |
| 14 | set_max_width(100.0f, Unit::Percent); |
| 15 | set_overflow_x(Overflow::Auto); |
| 16 | break; |
| 17 | case ScrollDirection::Vertical: |
| 18 | set_max_height(100.0f, Unit::Percent); |
| 19 | set_overflow_y(Overflow::Auto); |
| 20 | break; |
| 21 | default: |
| 22 | assert(false && "Unknown scroll direction."); |
| 23 | break; |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected