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

Fix repeated map api calls
pull/25808/head
Dean Lee 3 years ago committed by GitHub
parent b7d9f157fa
commit f0665911b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      selfdrive/ui/qt/maps/map.cc
  2. 2
      selfdrive/ui/qt/maps/map.h

@ -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--;
}

@ -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;

Loading…
Cancel
Save