From 4b1138ebc7e0c1edd9afd5e56dd69a8c36b9abbb Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 29 Jan 2022 11:06:58 +0100 Subject: [PATCH] Fixed an issue where ScrollableContainer could round its size to zero. Also added a sizing check to prevent application hangs on zero-sized containers. --- es-core/src/components/ScrollableContainer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/es-core/src/components/ScrollableContainer.cpp b/es-core/src/components/ScrollableContainer.cpp index 9f230f333..d7462c4a5 100644 --- a/es-core/src/components/ScrollableContainer.cpp +++ b/es-core/src/components/ScrollableContainer.cpp @@ -71,12 +71,17 @@ void ScrollableContainer::reset() if (mChildren.front()->getSize().y > mSize.y) { float numLines {mSize.y / combinedHeight}; mSize.y = floorf(numLines) * combinedHeight; + if (mSize.y == 0.0f) + mSize.y = combinedHeight; } } } void ScrollableContainer::update(int deltaTime) { + if (mSize == glm::vec2 {0.0f, 0.0f}) + return; + // Don't scroll if the media viewer or screensaver is active or if text scrolling is disabled; if (mWindow->isMediaViewerActive() || mWindow->isScreensaverActive() || !mWindow->getAllowTextScrolling()) {