diff --git a/src/graphics/ui/elements/Panel.cpp b/src/graphics/ui/elements/Panel.cpp index 885ae3d61..87796a50c 100644 --- a/src/graphics/ui/elements/Panel.cpp +++ b/src/graphics/ui/elements/Panel.cpp @@ -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; }