Fix bug with "flex" element not settings their box.

This commit is contained in:
ArthurSonzogni 2024-12-25 19:19:37 +01:00
parent a3cc6df32b
commit 25476f757b
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C
2 changed files with 3 additions and 1 deletions

View File

@ -163,6 +163,7 @@ class VerticalContainer : public ContainerBase {
return false; return false;
} }
int old_selected = *selector_;
if (event.mouse().button == Mouse::WheelUp) { if (event.mouse().button == Mouse::WheelUp) {
MoveSelector(-1); MoveSelector(-1);
} }
@ -171,7 +172,7 @@ class VerticalContainer : public ContainerBase {
} }
*selector_ = std::max(0, std::min(int(children_.size()) - 1, *selector_)); *selector_ = std::max(0, std::min(int(children_.size()) - 1, *selector_));
return true; return old_selected != *selector_;
} }
Box box_; Box box_;

View File

@ -80,6 +80,7 @@ class Flex : public Node {
} }
void SetBox(Box box) override { void SetBox(Box box) override {
Node::SetBox(box);
if (children_.empty()) { if (children_.empty()) {
return; return;
} }