Qt: Map Viewer touchups
Vicki Pfau vi@endrift.com
Sat, 23 Sep 2017 10:13:22 -0700
2 files changed,
34 insertions(+),
1 deletions(-)
M
src/platform/qt/MapView.cpp
→
src/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.ui
→
src/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>