diff --git a/es-core/src/components/ScrollableContainer.cpp b/es-core/src/components/ScrollableContainer.cpp index 74cbb7250..75171b237 100644 --- a/es-core/src/components/ScrollableContainer.cpp +++ b/es-core/src/components/ScrollableContainer.cpp @@ -78,6 +78,8 @@ void ScrollableContainer::reset() if (mChildren.front()->getSize().y > mSize.y) { if (mVerticalSnap) { float numLines {std::floor(mSize.y / combinedHeight)}; + if (numLines == 0) + numLines = 1; mAdjustedHeight = std::round(numLines * combinedHeight); } else { @@ -145,6 +147,8 @@ void ScrollableContainer::update(int deltaTime) if (!mUpdatedSize) { if (mVerticalSnap) { float numLines {std::floor(mSize.y / combinedHeight)}; + if (numLines == 0) + numLines = 1; mAdjustedHeight = std::round(numLines * combinedHeight); } else {