all repos — mgba @ 6e9507f0822f76bba63f29fba6a78d1f14f34b9f

mGBA Game Boy Advance Emulator

Qt: Map Viewer touchups
Vicki Pfau vi@endrift.com
Sat, 23 Sep 2017 10:13:22 -0700
commit

6e9507f0822f76bba63f29fba6a78d1f14f34b9f

parent

13e1f988c981f6663f6b1d59bdbf4d61036ed5e4

2 files changed, 34 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/MapView.cppsrc/platform/qt/MapView.cpp

@@ -65,7 +65,11 @@ void MapView::selectMap(int map) {

if (map >= mMapCacheSetSize(&m_cacheSet->maps)) { return; } + if (map == m_map) { + return; + } m_map = map; + updateTiles(true); } #ifdef M_CORE_GBA

@@ -88,7 +92,11 @@ }

} } bg = bg.convertToFormat(QImage::Format_RGB32).rgbSwapped(); - m_ui.map->setPixmap(QPixmap::fromImage(bg)); + QPixmap map = QPixmap::fromImage(bg); + if (m_ui.magnification->value() > 1) { + map = map.scaled(map.size() * m_ui.magnification->value()); + } + m_ui.map->setPixmap(map); } #endif
M src/platform/qt/MapView.uisrc/platform/qt/MapView.ui

@@ -32,12 +32,37 @@ <height>309</height>

</rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item> <widget class="QLabel" name="map"> <property name="text"> <string/> </property> </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> </item> </layout> </widget>