From a1dfd69c062a1741d2e783b2c34fd49a863119a0 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 21 Aug 2020 22:17:16 -0700 Subject: [PATCH] Qt: Fix Battle Chip view not displaying chips on some DPI settings --- CHANGES | 1 + src/platform/qt/BattleChipView.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 95c2639b9..0cef2f9c5 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ Other fixes: - GBA: Fix endianness issues in renderer proxy - GBA Core: Fix memory leak when loading symbols - Qt: Add dummy English translation file (fixes mgba.io/i/1469) + - Qt: Fix Battle Chip view not displaying chips on some DPI settings - mGUI: Fix closing down a game if an exit is signalled - mVL: Fix injecting accidentally draining non-injection buffer - VFS: Fix directory node listing on some filesystems diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index 7baa7deb5..5c9b2cb8f 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -42,6 +42,9 @@ BattleChipView::BattleChipView(std::shared_ptr controller, Windo #else int size = QFontMetrics(QFont()).height() / (devicePixelRatio() * 12); #endif + if (!size) { + size = 1; + } m_ui.chipList->setIconSize(m_ui.chipList->iconSize() * size); m_ui.chipList->setGridSize(m_ui.chipList->gridSize() * size); m_model.setScale(size); @@ -259,4 +262,4 @@ void BattleChipView::updateData() { m_updater = nullptr; }); m_updater->downloadUpdate(); -} \ No newline at end of file +}