diff options
author | Stijn Buys <ingar@telenet.be> | 2020-07-16 18:12:47 +0200 |
---|---|---|
committer | Stijn Buys <ingar@telenet.be> | 2020-07-16 18:12:47 +0200 |
commit | eda02d2c1f898e4c02ccd2317973c2b8463a7037 (patch) | |
tree | 9e1c593c2f052d1dd2ba24fd8daab6b0fc73aec6 /src/mapwidget.cc | |
parent | 1d4e93e3bd49c0b93eca7696092ee8b356bd6cae (diff) |
Diffstat (limited to 'src/mapwidget.cc')
-rw-r--r-- | src/mapwidget.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mapwidget.cc b/src/mapwidget.cc index b5f52d1..ba00799 100644 --- a/src/mapwidget.cc +++ b/src/mapwidget.cc @@ -47,11 +47,13 @@ float MapWidget::zoom() const void MapWidget::wheelEvent(QWheelEvent *event) { - if (event->orientation() == Qt::Vertical) { + QPoint p = event->angleDelta() / 120; - mapwidget_zoomfactor += event->delta() / 120; + if (!p.isNull()) { + + mapwidget_zoomfactor += p.y(); - if (mapwidget_zoomfactor < - 64) { + if (mapwidget_zoomfactor < -64) { mapwidget_zoomfactor = -64; } else if (mapwidget_zoomfactor > 64) { mapwidget_zoomfactor = 64; |