🪲 removeAllWidgets in ScrollablePanel did not reset content size when auto-sizing

0.8
Bruno Van de Velde 2017-09-20 00:05:03 +02:00
parent a0afbfb8c7
commit 51df0973bc
1 changed files with 5 additions and 0 deletions

View File

@ -123,7 +123,10 @@ namespace tgui
Panel::removeAllWidgets();
if (m_contentSize == sf::Vector2f{0, 0})
{
recalculateMostBottomRightPosition();
updateScrollbars();
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -350,6 +353,8 @@ namespace tgui
void ScrollablePanel::recalculateMostBottomRightPosition()
{
m_mostBottomRightPosition = {0, 0};
for (const auto& widget : m_widgets)
{
const sf::Vector2f bottomRight = widget->getPosition() + widget->getFullSize();