Skip to content

Commit

Permalink
Fixed crash that could occur in ListView when it's size was near 0
Browse files Browse the repository at this point in the history
  • Loading branch information
texus committed Dec 25, 2023
1 parent 95ee614 commit fcb0c58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Widgets/ListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int>(innerSize.y - m_horizontalScrollbar->getSize().y));
m_verticalScrollbar->setViewportSize(static_cast<unsigned int>(std::max(0.f, innerSize.y - m_horizontalScrollbar->getSize().y)));
}
else
{
Expand All @@ -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<unsigned int>(innerSize.x - m_verticalScrollbar->getSize().x));
m_horizontalScrollbar->setViewportSize(static_cast<unsigned int>(std::max(0.f, innerSize.x - m_verticalScrollbar->getSize().x)));
}
else
{
Expand Down

0 comments on commit fcb0c58

Please sign in to comment.