mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
fix horizontal panel behaviour
This commit is contained in:
parent
9ea50148b8
commit
2448869bf9
1 changed files with 13 additions and 6 deletions
|
|
@ -97,16 +97,23 @@ void Panel::refresh() {
|
||||||
} else {
|
} else {
|
||||||
float maxh = size.y;
|
float maxh = size.y;
|
||||||
for (auto& node : nodes) {
|
for (auto& node : nodes) {
|
||||||
glm::vec2 nodesize = node->getSize();
|
|
||||||
const glm::vec4 margin = node->getMargin();
|
const glm::vec4 margin = node->getMargin();
|
||||||
x += margin.x;
|
x += margin.x;
|
||||||
node->setPos(glm::vec2(x, y + margin.y));
|
|
||||||
x += nodesize.x + margin.z + interval;
|
|
||||||
|
|
||||||
node->refresh();
|
float ey = y + margin.y;
|
||||||
maxh = fmax(
|
node->setPos(glm::vec2(x, ey));
|
||||||
maxh, y + margin.y + node->getSize().y + margin.w + padding.w
|
|
||||||
|
int height = glm::floor(
|
||||||
|
size.y - padding.y - padding.w - margin.y - margin.w
|
||||||
);
|
);
|
||||||
|
if (node->isResizing()) {
|
||||||
|
node->setMaxSize({node->getMaxSize().x, height});
|
||||||
|
node->setSize(glm::vec2(node->getSize().x, height));
|
||||||
|
}
|
||||||
|
node->refresh();
|
||||||
|
glm::vec2 nodesize = node->getSize();
|
||||||
|
x += nodesize.x + margin.z + interval;
|
||||||
|
maxh = fmax(maxh, ey + nodesize.y + margin.w + padding.w);
|
||||||
}
|
}
|
||||||
actualLength = size.y;
|
actualLength = size.y;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue