mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix division by zero error in invalid TilePainter state
This commit is contained in:
parent
1002dfd0db
commit
2cb5a08f4f
1
CHANGES
1
CHANGES
|
@ -100,6 +100,7 @@ Other fixes:
|
||||||
- Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574)
|
- 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 scrollbar arrows in memory view (fixes mgba.io/i/1558)
|
||||||
- Qt: Fix several cases where shader selections don't get saved
|
- Qt: Fix several cases where shader selections don't get saved
|
||||||
|
- Qt: Fix division by zero error in invalid TilePainter state
|
||||||
Misc:
|
Misc:
|
||||||
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)
|
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)
|
||||||
- SDL: Use controller GUID instead of name
|
- SDL: Use controller GUID instead of name
|
||||||
|
|
|
@ -26,6 +26,9 @@ void TilePainter::paintEvent(QPaintEvent* event) {
|
||||||
|
|
||||||
void TilePainter::resizeEvent(QResizeEvent* event) {
|
void TilePainter::resizeEvent(QResizeEvent* event) {
|
||||||
int w = width() / m_size;
|
int w = width() / m_size;
|
||||||
|
if (!w) {
|
||||||
|
w = 1;
|
||||||
|
}
|
||||||
int calculatedHeight = (m_tileCount + w - 1) * m_size / w;
|
int calculatedHeight = (m_tileCount + w - 1) * m_size / w;
|
||||||
calculatedHeight -= calculatedHeight % m_size;
|
calculatedHeight -= calculatedHeight % m_size;
|
||||||
if (width() / m_size != m_backing.width() / m_size || m_backing.height() != calculatedHeight) {
|
if (width() / m_size != m_backing.width() / m_size || m_backing.height() != calculatedHeight) {
|
||||||
|
|
Loading…
Reference in New Issue