Fixed an issue in ScrollableContainer where the reset animation played when it shouldn't.

This commit is contained in:
Leon Styhre 2021-03-14 09:49:26 +01:00
parent 9a14bf3057
commit 6e58b5f2fa

View file

@ -113,7 +113,8 @@ void ScrollableContainer::update(int deltaTime)
if (adjustedAutoScrollSpeed != 0) {
mAutoScrollAccumulator += deltaTime;
while (mAutoScrollAccumulator >= adjustedAutoScrollSpeed) {
mScrollPos += mScrollDir;
if (contentSize.y() > mSize.y())
mScrollPos += mScrollDir;
mAutoScrollAccumulator -= adjustedAutoScrollSpeed;
}
}