mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2025-12-25 09:22:41 +00:00
27 lines
No EOL
756 B
C++
27 lines
No EOL
756 B
C++
#include "ui_scroll_container.h"
|
|
|
|
#include <cassert>
|
|
|
|
namespace recompui {
|
|
|
|
ScrollContainer::ScrollContainer(ScrollDirection direction, Element *parent) : Element(parent) {
|
|
set_flex(1.0f, 1.0f, 100.0f);
|
|
set_width(100.0f, Unit::Percent);
|
|
set_height(100.0f, Unit::Percent);
|
|
|
|
switch (direction) {
|
|
case ScrollDirection::Horizontal:
|
|
set_max_width(100.0f, Unit::Percent);
|
|
set_overflow_x(Overflow::Auto);
|
|
break;
|
|
case ScrollDirection::Vertical:
|
|
set_max_height(100.0f, Unit::Percent);
|
|
set_overflow_y(Overflow::Auto);
|
|
break;
|
|
default:
|
|
assert(false && "Unknown scroll direction.");
|
|
break;
|
|
}
|
|
}
|
|
|
|
}; |