mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
gui: added UINode.zindex
This commit is contained in:
parent
e1b2d8f7e4
commit
b6f675a540
6 changed files with 25 additions and 0 deletions
|
|
@ -144,6 +144,12 @@ void Container::setSize(glm::vec2 size) {
|
|||
refresh();
|
||||
}
|
||||
|
||||
void Container::refresh() {
|
||||
std::stable_sort(nodes.begin(), nodes.end(), [](const auto& a, const auto& b) {
|
||||
return a->getZIndex() < b->getZIndex();
|
||||
});
|
||||
}
|
||||
|
||||
const std::vector<std::shared_ptr<UINode>>& Container::getNodes() const {
|
||||
return nodes;
|
||||
}
|
||||
|
|
@ -190,6 +196,7 @@ void Panel::add(std::shared_ptr<UINode> node) {
|
|||
}
|
||||
|
||||
void Panel::refresh() {
|
||||
UINode::refresh();
|
||||
float x = padding.x;
|
||||
float y = padding.y;
|
||||
vec2 size = getSize();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue