Fixed an issue where ScrollableContainer would cause excessive stuttering with some legacy theme sets.

This commit is contained in:
Leon Styhre 2022-09-15 23:31:51 +02:00
parent 611824be18
commit 16880028d7
2 changed files with 3 additions and 4 deletions

View file

@ -192,9 +192,8 @@ void GamelistView::legacyPopulateFields()
// Scrollable container (game description).
mContainerComponents.push_back(std::make_unique<ScrollableContainer>());
mContainerComponents.back()->setThemeMetadata("text_md_description");
mContainerComponents.back()->setSize(mSize.x * (0.50f - 2.0f * padding),
mSize.y - mContainerComponents.back()->getPosition().y);
mContainerComponents.back()->setAutoScroll(true);
mContainerComponents.back()->setVisible(false);
mContainerComponents.back()->setDefaultZIndex(40.0f);
addChild(mContainerComponents.back().get());
@ -743,7 +742,7 @@ void GamelistView::legacyInitMDValues()
for (auto& container : mContainerComponents) {
container->setPosition(container->getPosition().x, bottom + mSize.y * 0.01f);
container->setSize(container->getSize().x, mSize.y - container->getPosition().y);
container->setSize(mSize.x * 0.2f, mSize.y * 0.2f);
}
}

View file

@ -108,7 +108,7 @@ void ScrollableContainer::applyTheme(const std::shared_ptr<ThemeData>& theme,
void ScrollableContainer::update(int deltaTime)
{
if (mSize == glm::vec2 {0.0f, 0.0f})
if (!isVisible() || 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;