Qt: Fix tile and sprite views not always displaying at first
Vicki Pfau vi@endrift.com
Sat, 09 Feb 2019 02:09:10 -0800
5 files changed,
9 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -6,6 +6,7 @@ - GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208)
- GBA: Reset now reloads multiboot ROMs - GBA BIOS: Fix multiboot entry point (fixes Magic Floor) - Switch: Fix final cleanup (fixes mgba.io/i/1283) + - Qt: Fix tile and sprite views not always displaying at first Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
M
src/platform/qt/ObjView.cpp
→
src/platform/qt/ObjView.cpp
@@ -46,6 +46,9 @@ m_ui.transform->setFont(font);
m_ui.mode->setFont(font); connect(m_ui.tiles, &TilePainter::indexPressed, this, &ObjView::translateIndex); + connect(m_ui.tiles, &TilePainter::needsRedraw, this, [this]() { + updateTiles(true); + }); connect(m_ui.objId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &ObjView::selectObj); connect(m_ui.magnification, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this]() { updateTiles(true);
M
src/platform/qt/TilePainter.cpp
→
src/platform/qt/TilePainter.cpp
@@ -31,6 +31,7 @@ calculatedHeight -= calculatedHeight % m_size;
if (width() / m_size != m_backing.width() / m_size || m_backing.height() != calculatedHeight) { m_backing = QPixmap(width(), calculatedHeight); m_backing.fill(Qt::transparent); + emit needsRedraw(); } }
M
src/platform/qt/TilePainter.h
→
src/platform/qt/TilePainter.h
@@ -26,6 +26,7 @@ void setTileMagnification(int mag);
signals: void indexPressed(int index); + void needsRedraw(); protected: void paintEvent(QPaintEvent*) override;
M
src/platform/qt/TileView.cpp
→
src/platform/qt/TileView.cpp
@@ -25,6 +25,9 @@ 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::needsRedraw, this, [this]() { + updateTiles(true); + }); connect(m_ui.paletteId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &TileView::updatePalette); switch (m_controller->platform()) {