MCPcopy Create free account
hub / github.com/RevoSucks/BM64Recomp / ScrollContainer

Method ScrollContainer

src/ui/elements/ui_scroll_container.cpp:7–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace 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};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected