diff --git a/CHANGES b/CHANGES index a8cbd7b87..221c201db 100644 --- a/CHANGES +++ b/CHANGES @@ -43,6 +43,7 @@ Other fixes: - GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396) - mGUI: Fix FPS counter after closing menu - Qt: Fix some hangs when using the debugger console + - Qt: Fix crash when clicking past last tile in viewer - VFS: Failed file mapping should return NULL on POSIX Misc: - Core: Suspend runloop when a core crashes diff --git a/src/platform/qt/TilePainter.cpp b/src/platform/qt/TilePainter.cpp index 9a1238699..c27ade72e 100644 --- a/src/platform/qt/TilePainter.cpp +++ b/src/platform/qt/TilePainter.cpp @@ -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) {