mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 11:32:21 +08:00
map: fix repeated call to m_map->setZoom (#25784)
Fix repeated map api calls old-commit-hash: f0665911b2aa5807348ee5bf209ee21b8be2ca89
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user