mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
fix containers refreshing
This commit is contained in:
parent
d845aeb55f
commit
34295faca2
4 changed files with 19 additions and 7 deletions
|
|
@ -71,10 +71,7 @@ void Container::mouseRelease(int x, int y) {
|
|||
}
|
||||
|
||||
void Container::act(float delta) {
|
||||
if (mustRefresh) {
|
||||
refresh();
|
||||
mustRefresh = false;
|
||||
}
|
||||
UINode::act(delta);
|
||||
for (const auto& node : nodes) {
|
||||
if (node->isVisible()) {
|
||||
node->act(delta);
|
||||
|
|
@ -167,6 +164,12 @@ void Container::add(const std::shared_ptr<UINode>& node) {
|
|||
node->setParent(this);
|
||||
node->reposition();
|
||||
mustRefresh = true;
|
||||
|
||||
auto parent = getParent();
|
||||
while (parent) {
|
||||
parent->setMustRefresh();
|
||||
parent = parent->getParent();
|
||||
}
|
||||
}
|
||||
|
||||
void Container::add(const std::shared_ptr<UINode>& node, glm::vec2 pos) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue