diff --git a/CHANGES b/CHANGES index e4d256623..aaa95489f 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ Other fixes: - Qt: Fix overrides getting discarded (fixes mgba.io/i/1354) - Qt: Fix saved scale not getting set on resize (fixes mgba.io/i/1074) - CMake: Fix .deb imagemagick dependencies + - Qt: Fix crash in sprite viewer magnification (fixes mgba.io/i/1362) Misc: - Qt: Add missing HEVC NVENC option (fixes mgba.io/i/1323) - Qt: Improve camera initialization diff --git a/src/platform/qt/TilePainter.cpp b/src/platform/qt/TilePainter.cpp index 042d04732..b9417b827 100644 --- a/src/platform/qt/TilePainter.cpp +++ b/src/platform/qt/TilePainter.cpp @@ -62,8 +62,11 @@ void TilePainter::setTileCount(int tiles) { setMinimumSize(m_size, h - (h % m_size)); } else { int w = minimumSize().width() / m_size; + if (!w) { + w = 1; + } int h = (tiles + w - 1) * m_size / w; - setMinimumSize(minimumSize().width(), h - (h % m_size)); + setMinimumSize(w * m_size, h - (h % m_size)); } resizeEvent(nullptr); }