diff options
author | Julian Rex <julian.rex@mapbox.com> | 2019-08-23 16:11:41 -0400 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2019-08-26 08:09:00 -0400 |
commit | 0543070d5619e173db5c6a94da2f1d86eb4de170 (patch) | |
tree | 5a5b4c824fd82101d5aff69e839ef6246c594a0c | |
parent | 683753f9e5e2c63447504a37693497850ed7d28d (diff) | |
download | qtlocation-mapboxgl-0543070d5619e173db5c6a94da2f1d86eb4de170.tar.gz |
[core] Removes jumpTo parameter, and explicitly calls transitionFinishFn in flyTo.
-rw-r--r-- | src/mbgl/map/transform.cpp | 9 | ||||
-rw-r--r-- | src/mbgl/map/transform.hpp | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 8667265278..f63513bb34 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -72,8 +72,8 @@ CameraOptions Transform::getCameraOptions(const EdgeInsets& padding) const { * a transition. The map will retain the current values for any options * not included in `options`. */ -void Transform::jumpTo(const CameraOptions& camera, std::function<void()> finish) { - easeTo(camera, finish); +void Transform::jumpTo(const CameraOptions& camera) { + easeTo(camera); } /** @@ -279,7 +279,10 @@ void Transform::flyTo(const CameraOptions &camera, const AnimationOptions &anima } if (duration == Duration::zero()) { // Perform an instantaneous transition. - jumpTo(camera, animation.transitionFinishFn); + jumpTo(camera); + if (animation.transitionFinishFn) { + animation.transitionFinishFn(); + } return; } diff --git a/src/mbgl/map/transform.hpp b/src/mbgl/map/transform.hpp index 7813d8aa5b..ffeff3859c 100644 --- a/src/mbgl/map/transform.hpp +++ b/src/mbgl/map/transform.hpp @@ -32,7 +32,7 @@ public: CameraOptions getCameraOptions(const EdgeInsets&) const; /** Instantaneously, synchronously applies the given camera options. */ - void jumpTo(const CameraOptions&, std::function<void()> finish = nullptr); + void jumpTo(const CameraOptions&); /** Asynchronously transitions all specified camera options linearly along an optional time curve. However, center coordinate is not transitioned linearly as, instead, ground speed is kept linear.*/ |