mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix crash when clicking past last tile in viewer
This commit is contained in:
parent
2ce04545b1
commit
ac8861a429
1
CHANGES
1
CHANGES
|
@ -10,6 +10,7 @@ Other fixes:
|
|||
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)
|
||||
- GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396)
|
||||
- mGUI: Fix FPS counter after closing menu
|
||||
- Qt: Fix crash when clicking past last tile in viewer
|
||||
- VFS: Failed file mapping should return NULL on POSIX
|
||||
Misc:
|
||||
- GB MBC: Filter out MBC errors when cartridge is yanked (fixes mgba.io/i/2488)
|
||||
|
|
|
@ -41,7 +41,10 @@ void TilePainter::resizeEvent(QResizeEvent*) {
|
|||
void TilePainter::mousePressEvent(QMouseEvent* event) {
|
||||
int x = event->x() / m_size;
|
||||
int y = event->y() / m_size;
|
||||
emit indexPressed(y * (width() / m_size) + x);
|
||||
int index = y * (width() / m_size) + x;
|
||||
if (index < m_tileCount) {
|
||||
emit indexPressed(index);
|
||||
}
|
||||
}
|
||||
|
||||
void TilePainter::clearTile(int index) {
|
||||
|
|
Loading…
Reference in New Issue