mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix containers scroll
This commit is contained in:
parent
b06bbd3f7d
commit
bf50c37b82
3 changed files with 4 additions and 1 deletions
|
|
@ -114,7 +114,7 @@ void Container::act(float delta) {
|
|||
|
||||
void Container::scrolled(int value) {
|
||||
auto size = getSize();
|
||||
bool isVertical = actualLengthY > size.y;
|
||||
bool isVertical = mainScrollDir == Orientation::VERTICAL;
|
||||
int diff = (isVertical ? actualLengthY - size.y : actualLengthX - size.x);
|
||||
int& scroll = (isVertical ? scrollY : scrollX);
|
||||
|
||||
|
|
@ -245,6 +245,7 @@ void Container::setSize(const glm::vec2& size) {
|
|||
for (auto& node : nodes) {
|
||||
node->reposition();
|
||||
}
|
||||
scrolled(0);
|
||||
}
|
||||
|
||||
int Container::getScrollStep() const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue