fix horizontal panel behaviour

This commit is contained in:
MihailRis 2026-08-07 00:02:39 +03:00
parent 9ea50148b8
commit 2448869bf9

View file

@ -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;
}