all repos — mgba @ 2cb5a08f4f02468e351cab80a92f5803ec3356cf

mGBA Game Boy Advance Emulator

Qt: Fix division by zero error in invalid TilePainter state
Vicki Pfau vi@endrift.com
Wed, 18 Dec 2019 18:23:40 -0800
commit

2cb5a08f4f02468e351cab80a92f5803ec3356cf

parent

1002dfd0dbd86950145493c82ff1af7744e60c81

2 files changed, 4 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.cppsrc/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) {