diff --git a/CHANGES b/CHANGES index 6dc5bcdce..09a028618 100644 --- a/CHANGES +++ b/CHANGES @@ -100,6 +100,7 @@ Other fixes: - Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574) - Qt: Fix scrollbar arrows in memory view (fixes mgba.io/i/1558) - Qt: Fix several cases where shader selections don't get saved + - Qt: Fix division by zero error in invalid TilePainter state Misc: - GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580) - SDL: Use controller GUID instead of name diff --git a/src/platform/qt/TilePainter.cpp b/src/platform/qt/TilePainter.cpp index b9417b827..127b31058 100644 --- a/src/platform/qt/TilePainter.cpp +++ b/src/platform/qt/TilePainter.cpp @@ -26,6 +26,9 @@ void TilePainter::paintEvent(QPaintEvent* event) { void TilePainter::resizeEvent(QResizeEvent* event) { int w = width() / m_size; + if (!w) { + w = 1; + } int calculatedHeight = (m_tileCount + w - 1) * m_size / w; calculatedHeight -= calculatedHeight % m_size; if (width() / m_size != m_backing.width() / m_size || m_backing.height() != calculatedHeight) {