map: fix repeated call to m_map->setZoom (#25784)

Fix repeated map api calls
old-commit-hash: f0665911b2aa5807348ee5bf209ee21b8be2ca89
This commit is contained in:
Dean Lee
2022-09-16 11:36:13 +08:00
committed by GitHub
parent 91283ad0b5
commit 53c4262098
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -204,7 +204,8 @@ void MapWindow::updateState(const UIState &s) {
if (zoom_counter == 0) {
m_map->setZoom(util::map_val<float>(velocity_filter.x(), 0, 30, MAX_ZOOM, MIN_ZOOM));
} else {
zoom_counter = -1;
} else if (zoom_counter > 0) {
zoom_counter--;
}
+1 -1
View File
@@ -98,7 +98,7 @@ private:
// Panning
QPointF m_lastPos;
int pan_counter = 0;
int zoom_counter = 0;
int zoom_counter = -1;
// Position
std::optional<QMapbox::Coordinate> last_position;