Skip to content

Commit

Permalink
Merge pull request #594 from openmobilemaps/bugfix/restrict-bounds-on…
Browse files Browse the repository at this point in the history
…-one-finger-zoom

Restrict camera to bounds when zooming with tap and move
  • Loading branch information
maurhofer-ubique authored Feb 9, 2024
2 parents 5ef6af7 + 6aa4251 commit dd18515
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions shared/src/map/camera/MapCamera2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ bool MapCamera2d::onMove(const Vec2F &deltaScreen, bool confirmed, bool doubleCl
double newZoom = zoom * (1.0 - (deltaScreen.y * 0.003));

zoom = std::max(std::min(newZoom, zoomMin), zoomMax);
clampCenterToPaddingCorrectedBounds();

notifyListeners(ListenerType::BOUNDS | ListenerType::MAP_INTERACTION);
mapInterface->invalidate();
Expand Down

0 comments on commit dd18515

Please sign in to comment.