Set children parent in ui::container
This commit is contained in:
parent
d42e1b1bcb
commit
8feb15fc5c
1 changed files with 2 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ namespace psemek::ui
|
||||||
}
|
}
|
||||||
|
|
||||||
children_[index] = std::move(c);
|
children_[index] = std::move(c);
|
||||||
|
if (children_[index]) children_[index]->set_parent(this);
|
||||||
children_range_[index] = children_[index].get();
|
children_range_[index] = children_[index].get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,6 +60,7 @@ namespace psemek::ui
|
||||||
|
|
||||||
auto c = std::move(children_[index]);
|
auto c = std::move(children_[index]);
|
||||||
children_range_[index] = nullptr;
|
children_range_[index] = nullptr;
|
||||||
|
if (c) c->set_parent(nullptr);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue