| 510 | } |
| 511 | |
| 512 | void MapWidget::wheelEvent(QWheelEvent * e) |
| 513 | { |
| 514 | if (m_screenshotMode) |
| 515 | return; |
| 516 | |
| 517 | QOpenGLWidget::wheelEvent(e); |
| 518 | |
| 519 | QPointF const pos = e->position(); |
| 520 | |
| 521 | double const factor = e->angleDelta().y() / 3.0 / 360.0; |
| 522 | // https://doc-snapshots.qt.io/qt6-dev/qwheelevent.html#angleDelta, angleDelta() returns in eighths of a degree. |
| 523 | /// @todo Here you can tune the speed of zooming. |
| 524 | m_framework.Scale(exp(factor), m2::PointD(L2D(pos.x()), L2D(pos.y())), false); |
| 525 | } |
| 526 | } // namespace qt::common |