diff options
Diffstat (limited to 'platform/qt')
-rw-r--r-- | platform/qt/app/mapwindow.cpp | 2 | ||||
-rw-r--r-- | platform/qt/include/qmapboxgl.hpp | 1 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp index 47dc1c8190..6171c8bf35 100644 --- a/platform/qt/app/mapwindow.cpp +++ b/platform/qt/app/mapwindow.cpp @@ -437,7 +437,7 @@ void MapWindow::mouseMoveEvent(QMouseEvent *ev) if (!delta.isNull()) { if (ev->buttons() == Qt::LeftButton && ev->modifiers() & Qt::ShiftModifier) { - m_map->setPitch(m_map->pitch() - delta.y()); + m_map->pitchBy(delta.y()); } else if (ev->buttons() == Qt::LeftButton) { m_map->moveBy(delta); } else if (ev->buttons() == Qt::RightButton) { diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp index d29c9fc2c6..5309c58494 100644 --- a/platform/qt/include/qmapboxgl.hpp +++ b/platform/qt/include/qmapboxgl.hpp @@ -182,6 +182,7 @@ public: double pitch() const; void setPitch(double pitch); + void pitchBy(double pitch); NorthOrientation northOrientation() const; void setNorthOrientation(NorthOrientation); diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index e512b23901..cc4028b64d 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -885,6 +885,11 @@ void QMapboxGL::setPitch(double pitch_) d_ptr->mapObj->setPitch(pitch_); } +void QMapboxGL::pitchBy(double pitch_) +{ + d_ptr->mapObj->pitchBy(pitch_); +} + /*! Returns the north orientation mode. */ |