Qt: Fix crash in sprite viewer magnification (fixes #1362)

This commit is contained in:
Vicki Pfau 2019-03-22 23:05:29 -07:00
parent f3caf890b0
commit 84a7b6a316
2 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,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:
- GBA Savedata: EEPROM performance fixes
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash

View File

@ -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);
}