mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed an issue where ScrollableContainer could round its size to zero.
Also added a sizing check to prevent application hangs on zero-sized containers.
This commit is contained in:
parent
24f65a2560
commit
4b1138ebc7
|
@ -71,12 +71,17 @@ void ScrollableContainer::reset()
|
||||||
if (mChildren.front()->getSize().y > mSize.y) {
|
if (mChildren.front()->getSize().y > mSize.y) {
|
||||||
float numLines {mSize.y / combinedHeight};
|
float numLines {mSize.y / combinedHeight};
|
||||||
mSize.y = floorf(numLines) * combinedHeight;
|
mSize.y = floorf(numLines) * combinedHeight;
|
||||||
|
if (mSize.y == 0.0f)
|
||||||
|
mSize.y = combinedHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollableContainer::update(int deltaTime)
|
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;
|
// Don't scroll if the media viewer or screensaver is active or if text scrolling is disabled;
|
||||||
if (mWindow->isMediaViewerActive() || mWindow->isScreensaverActive() ||
|
if (mWindow->isMediaViewerActive() || mWindow->isScreensaverActive() ||
|
||||||
!mWindow->getAllowTextScrolling()) {
|
!mWindow->getAllowTextScrolling()) {
|
||||||
|
|
Loading…
Reference in a new issue