From 4d79e75b150be49f918113096eadabe69bc318f0 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 24 May 2022 02:24:08 -0700 Subject: [PATCH] draw instantly when dragging --- selfdrive/ui/qt/maps/map.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index 02761f9933..6971579cb3 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -253,6 +253,7 @@ void MapWindow::mouseDoubleClickEvent(QMouseEvent *ev) { if (last_position) m_map->setCoordinate(*last_position); if (last_bearing) m_map->setBearing(*last_bearing); m_map->setZoom(util::map_val(velocity_filter.x(), 0, 30, MAX_ZOOM, MIN_ZOOM)); + update(); pan_counter = 0; zoom_counter = 0; @@ -264,6 +265,7 @@ void MapWindow::mouseMoveEvent(QMouseEvent *ev) { if (!delta.isNull()) { pan_counter = PAN_TIMEOUT; m_map->moveBy(delta / MAP_SCALE); + update(); } m_lastPos = ev->localPos(); @@ -281,6 +283,8 @@ void MapWindow::wheelEvent(QWheelEvent *ev) { } m_map->scaleBy(1 + factor, ev->pos() / MAP_SCALE); + update(); + zoom_counter = PAN_TIMEOUT; ev->accept(); } @@ -305,6 +309,8 @@ void MapWindow::pinchTriggered(QPinchGesture *gesture) { if (changeFlags & QPinchGesture::ScaleFactorChanged) { // TODO: figure out why gesture centerPoint doesn't work m_map->scaleBy(gesture->scaleFactor(), {width() / 2.0 / MAP_SCALE, height() / 2.0 / MAP_SCALE}); + update(); + zoom_counter = PAN_TIMEOUT; } }