Qt: Fix division by zero error in invalid TilePainter state
Vicki Pfau vi@endrift.com
Wed, 18 Dec 2019 18:23:40 -0800
2 files changed,
4 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -100,6 +100,7 @@ - Vita: Fix analog controls (fixes mgba.io/i/1554)
- 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
M
src/platform/qt/TilePainter.cpp
→
src/platform/qt/TilePainter.cpp
@@ -26,6 +26,9 @@ }
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) {