From 418898fe940cddcc1caa2786d31e4e305d71568a Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 25 Jul 2022 18:50:57 +1000 Subject: [PATCH] Qt: Fix possible cover cache overflow when zooming --- src/duckstation-qt/gamelistwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index 6193940f2..92a8e1a80 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -86,6 +86,7 @@ void GameListWidget::initialize() m_model = new GameListModel(this); m_model->setCoverScale(Host::GetBaseFloatSettingValue("UI", "GameListCoverArtScale", 0.45f)); m_model->setShowCoverTitles(Host::GetBaseBoolSettingValue("UI", "GameListShowCoverTitles", true)); + m_model->updateCacheSize(width(), height()); m_sort_model = new GameListSortModel(m_model); m_sort_model->setSourceModel(m_model); @@ -322,6 +323,7 @@ void GameListWidget::listZoom(float delta) const float new_scale = std::clamp(m_model->getCoverScale() + delta, MIN_SCALE, MAX_SCALE); Host::SetBaseFloatSettingValue("UI", "GameListCoverArtScale", new_scale); m_model->setCoverScale(new_scale); + m_model->updateCacheSize(width(), height()); updateListFont(); updateToolbar(); @@ -344,6 +346,7 @@ void GameListWidget::gridIntScale(int int_scale) Host::SetBaseFloatSettingValue("UI", "GameListCoverArtScale", new_scale); m_model->setCoverScale(new_scale); + m_model->updateCacheSize(width(), height()); updateListFont(); updateToolbar();