From 089a09a92af2537be8ae239a89bc2c68b6d75672 Mon Sep 17 00:00:00 2001 From: Jason Young <46612682+jyoung8607@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:45:32 -0400 Subject: [PATCH] nav ui: restore speed-adaptive map zoom level (#28796) Revert "map: fix repeated call to m_map->setZoom (#25784)" This reverts commit 00cc1831bb13d838ba5df4fdfc6c071f7c704493. old-commit-hash: e816c81a5af8684cf3eb6f0c9d578cf82ebc1588 --- selfdrive/ui/qt/maps/map.cc | 3 +-- selfdrive/ui/qt/maps/map.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index d689674260..56c738d7d8 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -194,8 +194,7 @@ void MapWindow::updateState(const UIState &s) { if (zoom_counter == 0) { m_map->setZoom(util::map_val(velocity_filter.x(), 0, 30, MAX_ZOOM, MIN_ZOOM)); - zoom_counter = -1; - } else if (zoom_counter > 0) { + } else { zoom_counter--; } diff --git a/selfdrive/ui/qt/maps/map.h b/selfdrive/ui/qt/maps/map.h index 6bf326a3fe..cba8a4f7e3 100644 --- a/selfdrive/ui/qt/maps/map.h +++ b/selfdrive/ui/qt/maps/map.h @@ -100,7 +100,7 @@ private: // Panning QPointF m_lastPos; int pan_counter = 0; - int zoom_counter = -1; + int zoom_counter = 0; // Position std::optional last_position;