diff --git a/src/Widgets/ListView.cpp b/src/Widgets/ListView.cpp index 0ac7f1a50..bb7eb8324 100644 --- a/src/Widgets/ListView.cpp +++ b/src/Widgets/ListView.cpp @@ -2742,7 +2742,7 @@ namespace tgui if (m_horizontalScrollbar->isShown()) { m_verticalScrollbar->setSize({m_verticalScrollbar->getSize().x, std::max(0.f, getInnerSize().y) - m_horizontalScrollbar->getSize().y}); - m_verticalScrollbar->setViewportSize(static_cast(innerSize.y - m_horizontalScrollbar->getSize().y)); + m_verticalScrollbar->setViewportSize(static_cast(std::max(0.f, innerSize.y - m_horizontalScrollbar->getSize().y))); } else { @@ -2753,7 +2753,7 @@ namespace tgui if (m_verticalScrollbar->isShown()) { m_horizontalScrollbar->setSize({getInnerSize().x - m_verticalScrollbar->getSize().x, m_horizontalScrollbar->getSize().y}); - m_horizontalScrollbar->setViewportSize(static_cast(innerSize.x - m_verticalScrollbar->getSize().x)); + m_horizontalScrollbar->setViewportSize(static_cast(std::max(0.f, innerSize.x - m_verticalScrollbar->getSize().x))); } else {