mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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 {
|
||||
float maxh = size.y;
|
||||
for (auto& node : nodes) {
|
||||
glm::vec2 nodesize = node->getSize();
|
||||
const glm::vec4 margin = node->getMargin();
|
||||
x += margin.x;
|
||||
node->setPos(glm::vec2(x, y + margin.y));
|
||||
x += nodesize.x + margin.z + interval;
|
||||
|
||||
node->refresh();
|
||||
maxh = fmax(
|
||||
maxh, y + margin.y + node->getSize().y + margin.w + padding.w
|
||||
float ey = y + margin.y;
|
||||
node->setPos(glm::vec2(x, ey));
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue