mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed an issue where single-line scrollable containers could make the application hang.
This commit is contained in:
parent
5d5eaf2de2
commit
e096aef4e4
|
@ -78,6 +78,8 @@ void ScrollableContainer::reset()
|
||||||
if (mChildren.front()->getSize().y > mSize.y) {
|
if (mChildren.front()->getSize().y > mSize.y) {
|
||||||
if (mVerticalSnap) {
|
if (mVerticalSnap) {
|
||||||
float numLines {std::floor(mSize.y / combinedHeight)};
|
float numLines {std::floor(mSize.y / combinedHeight)};
|
||||||
|
if (numLines == 0)
|
||||||
|
numLines = 1;
|
||||||
mAdjustedHeight = std::round(numLines * combinedHeight);
|
mAdjustedHeight = std::round(numLines * combinedHeight);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -145,6 +147,8 @@ void ScrollableContainer::update(int deltaTime)
|
||||||
if (!mUpdatedSize) {
|
if (!mUpdatedSize) {
|
||||||
if (mVerticalSnap) {
|
if (mVerticalSnap) {
|
||||||
float numLines {std::floor(mSize.y / combinedHeight)};
|
float numLines {std::floor(mSize.y / combinedHeight)};
|
||||||
|
if (numLines == 0)
|
||||||
|
numLines = 1;
|
||||||
mAdjustedHeight = std::round(numLines * combinedHeight);
|
mAdjustedHeight = std::round(numLines * combinedHeight);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue