Qt: Map Viewer touchups

This commit is contained in:
Vicki Pfau 2017-09-23 10:13:22 -07:00
parent 13e1f988c9
commit 6e9507f082
2 changed files with 34 additions and 1 deletions

View File

@ -65,7 +65,11 @@ void MapView::selectMap(int map) {
if (map >= mMapCacheSetSize(&m_cacheSet->maps)) { if (map >= mMapCacheSetSize(&m_cacheSet->maps)) {
return; return;
} }
if (map == m_map) {
return;
}
m_map = map; m_map = map;
updateTiles(true);
} }
#ifdef M_CORE_GBA #ifdef M_CORE_GBA
@ -88,7 +92,11 @@ void MapView::updateTilesGBA(bool force) {
} }
} }
bg = bg.convertToFormat(QImage::Format_RGB32).rgbSwapped(); 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 #endif

View File

@ -32,6 +32,18 @@
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <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> <item>
<widget class="QLabel" name="map"> <widget class="QLabel" name="map">
<property name="text"> <property name="text">
@ -39,6 +51,19 @@
</property> </property>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
</widget> </widget>