mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 03:22:07 +08:00
nav: restore zoom and position on double click (#21551)
old-commit-hash: 86c255e3e881c81d6066b04f1d118fddb39b4a81
This commit is contained in:
@@ -400,6 +400,12 @@ void MapWindow::mousePressEvent(QMouseEvent *ev) {
|
||||
ev->accept();
|
||||
}
|
||||
|
||||
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<float>(velocity_filter.x(), 0, 30, MAX_ZOOM, MIN_ZOOM));
|
||||
}
|
||||
|
||||
void MapWindow::mouseMoveEvent(QMouseEvent *ev) {
|
||||
QPointF delta = ev->localPos() - m_lastPos;
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ private:
|
||||
void initLayers();
|
||||
|
||||
void mousePressEvent(QMouseEvent *ev) final;
|
||||
void mouseDoubleClickEvent(QMouseEvent *ev) final;
|
||||
void mouseMoveEvent(QMouseEvent *ev) final;
|
||||
void wheelEvent(QWheelEvent *ev) final;
|
||||
bool event(QEvent *event) final;
|
||||
|
||||
Reference in New Issue
Block a user