mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Fixed a ScrollableContainer sizing issue while running in the background when games are launched.
This commit is contained in:
parent
71b9a3a255
commit
7ebf895613
|
@ -64,6 +64,16 @@ void ScrollableContainer::reset()
|
||||||
mAutoScrollResetAccumulator = 0;
|
mAutoScrollResetAccumulator = 0;
|
||||||
mAutoScrollAccumulator = -mAutoScrollDelay + mAutoScrollSpeed;
|
mAutoScrollAccumulator = -mAutoScrollDelay + mAutoScrollSpeed;
|
||||||
mAtEnd = false;
|
mAtEnd = false;
|
||||||
|
// This is needed to resize to the font height boundary when we keep running in the background
|
||||||
|
// while launching games.
|
||||||
|
if (!mChildren.empty()) {
|
||||||
|
float combinedHeight{
|
||||||
|
mChildren.front()->getFont()->getHeight(mChildren.front()->getLineSpacing())};
|
||||||
|
if (mChildren.front()->getSize().y > mSize.y) {
|
||||||
|
float numLines{mSize.y / combinedHeight};
|
||||||
|
mSize.y = floorf(numLines) * combinedHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollableContainer::update(int deltaTime)
|
void ScrollableContainer::update(int deltaTime)
|
||||||
|
|
Loading…
Reference in a new issue