-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Fix incorrect center coordinate after pinch gesture #15097
Conversation
Thanks for jumping on this, @astojilj — this does indeed fix the rotation issue I was seeing, at the very least. (I haven’t looked wider yet.) To confirm that this fixes the full range of the reported problems (annotation selection, wrong center coordinate, etc.) are there tests that we can add? |
@friedbunny I have added a changelog for this PR and have tested manually. I added some rotation/selection tests in https://github.com/mapbox/mapbox-gl-native/tree/jrex/rotation-tests, but they do not repro this particular issue. I will try to add another for this. Can you please review and merge? (or I'll merge given that @astojilj is on vacation). @astojilj does this same fix need to be added to the macOS's |
Regarding tests: |
To changelog: Fixed incorrect center coordinate after pinch regression caused by edge insets fix (#14664). While working on #14664, missed to understand the logic used in ``` CLLocationCoordinate2D centerCoordinate = _previousPinchCenterCoordinate; mbgl::EdgeInsets padding { centerPoint.y, centerPoint.x, self.size.height - centerPoint.y, self.size.width - centerPoint.x }; self.mbglMap.jumpTo(mbgl::CameraOptions() .withCenter(MGLLatLngFromLocationCoordinate2D(centerCoordinate)) .withPadding(padding)); ``` Replacing this code by moveBy achieves the required translation. Fixes: #14977, #15082
0eb2f70
to
e20de77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Thanks - it is only for iOS. |
To changelogs:
Fixed incorrect center coordinate after pinch regression caused by edge insets fix (#14664).
While working on #14664, missed to understand the logic used in
Replacing this code by moveBy achieves the required translation.
Fixes #14977 and fixes #15082.