mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-30 01:25:51 +00:00
Qt: Fix possible cover cache overflow when zooming
This commit is contained in:
parent
a8f5146010
commit
418898fe94
|
@ -86,6 +86,7 @@ void GameListWidget::initialize()
|
||||||
m_model = new GameListModel(this);
|
m_model = new GameListModel(this);
|
||||||
m_model->setCoverScale(Host::GetBaseFloatSettingValue("UI", "GameListCoverArtScale", 0.45f));
|
m_model->setCoverScale(Host::GetBaseFloatSettingValue("UI", "GameListCoverArtScale", 0.45f));
|
||||||
m_model->setShowCoverTitles(Host::GetBaseBoolSettingValue("UI", "GameListShowCoverTitles", true));
|
m_model->setShowCoverTitles(Host::GetBaseBoolSettingValue("UI", "GameListShowCoverTitles", true));
|
||||||
|
m_model->updateCacheSize(width(), height());
|
||||||
|
|
||||||
m_sort_model = new GameListSortModel(m_model);
|
m_sort_model = new GameListSortModel(m_model);
|
||||||
m_sort_model->setSourceModel(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);
|
const float new_scale = std::clamp(m_model->getCoverScale() + delta, MIN_SCALE, MAX_SCALE);
|
||||||
Host::SetBaseFloatSettingValue("UI", "GameListCoverArtScale", new_scale);
|
Host::SetBaseFloatSettingValue("UI", "GameListCoverArtScale", new_scale);
|
||||||
m_model->setCoverScale(new_scale);
|
m_model->setCoverScale(new_scale);
|
||||||
|
m_model->updateCacheSize(width(), height());
|
||||||
updateListFont();
|
updateListFont();
|
||||||
updateToolbar();
|
updateToolbar();
|
||||||
|
|
||||||
|
@ -344,6 +346,7 @@ void GameListWidget::gridIntScale(int int_scale)
|
||||||
|
|
||||||
Host::SetBaseFloatSettingValue("UI", "GameListCoverArtScale", new_scale);
|
Host::SetBaseFloatSettingValue("UI", "GameListCoverArtScale", new_scale);
|
||||||
m_model->setCoverScale(new_scale);
|
m_model->setCoverScale(new_scale);
|
||||||
|
m_model->updateCacheSize(width(), height());
|
||||||
updateListFont();
|
updateListFont();
|
||||||
updateToolbar();
|
updateToolbar();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue