From 672867f1f6ddff17bf6be48f0c465ec430b53de1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 12 Apr 2022 22:19:33 -0700 Subject: [PATCH] Qt: Fix selecting tiles in OBJ-only view (fixes #2497) --- src/platform/qt/TileView.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/platform/qt/TileView.cpp b/src/platform/qt/TileView.cpp index 23cba18fd..3fba7ffd4 100644 --- a/src/platform/qt/TileView.cpp +++ b/src/platform/qt/TileView.cpp @@ -25,7 +25,20 @@ TileView::TileView(std::shared_ptr controller, QWidget* parent) m_ui.setupUi(this); m_ui.tile->setController(controller); - connect(m_ui.tiles, &TilePainter::indexPressed, m_ui.tile, &AssetTile::selectIndex); + connect(m_ui.tiles, &TilePainter::indexPressed, this, [this](int index) { + if (m_ui.tilesObj->isChecked()) { + switch (m_controller->platform()) { +#ifdef M_CORE_GBA + case mPLATFORM_GBA: + index += 2048 >> m_ui.palette256->isChecked(); + break; +#endif + default: + break; + } + } + m_ui.tile->selectIndex(index); + }); connect(m_ui.tiles, &TilePainter::needsRedraw, this, [this]() { updateTiles(true); });