diff options
author | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-11-04 08:12:23 +0200 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-11-13 13:31:01 +0200 |
commit | 4c1d03c257754ecc1555f3e31b3c6ccf45c4bf7b (patch) | |
tree | d6bd914727d337216e269b08b139a87bca7f41d4 /src | |
parent | 089ff8e2b34583de6c989c05a0771b108b3c82f0 (diff) | |
download | qtlocation-mapboxgl-4c1d03c257754ecc1555f3e31b3c6ccf45c4bf7b.tar.gz |
[core] Fix MapSnapshotter build failure on Windows
MSVC implementation of std::promise is buggy and only works with types
that can be default-constructed. To avoid a compilation failure in the
instantiation of ask() inside MapSnapshotter::getRegion(), which creates
a std::promise<LanLngBounds>, make LatLngBounds' default constructor
public.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/map/transform.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/map/transform_state.cpp | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index e88bb5465c..6b44e633d9 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -83,14 +83,14 @@ void Transform::jumpTo(const CameraOptions& camera) { */ void Transform::easeTo(const CameraOptions& camera, const AnimationOptions& animation) { Duration duration = animation.duration.value_or(Duration::zero()); - if (state.bounds == LatLngBounds::unbounded() && !isGestureInProgress() && duration != Duration::zero()) { + if (state.bounds == LatLngBounds() && !isGestureInProgress() && duration != Duration::zero()) { // reuse flyTo, without exaggerated animation, to achieve constant ground speed. return flyTo(camera, animation, true); } const EdgeInsets& padding = camera.padding.value_or(state.edgeInsets); LatLng startLatLng = getLatLng(LatLng::Unwrapped); const LatLng& unwrappedLatLng = camera.center.value_or(startLatLng); - const LatLng& latLng = state.bounds != LatLngBounds::unbounded() ? unwrappedLatLng : unwrappedLatLng.wrapped(); + const LatLng& latLng = state.bounds != LatLngBounds() ? unwrappedLatLng : unwrappedLatLng.wrapped(); double zoom = camera.zoom.value_or(getZoom()); double bearing = camera.bearing ? -*camera.bearing * util::DEG2RAD : getBearing(); double pitch = camera.pitch ? *camera.pitch * util::DEG2RAD : getPitch(); @@ -102,7 +102,7 @@ void Transform::easeTo(const CameraOptions& camera, const AnimationOptions& anim return; } - if (state.bounds == LatLngBounds::unbounded()) { + if (state.bounds == LatLngBounds()) { if (isGestureInProgress()) { // If gesture in progress, we transfer the wrap rounds from the end longitude into // start, so the "scroll effect" of rounding the world is the same while assuring the diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp index 61007422cb..f3cd8c3886 100644 --- a/src/mbgl/map/transform_state.cpp +++ b/src/mbgl/map/transform_state.cpp @@ -10,11 +10,7 @@ namespace mbgl { TransformState::TransformState(ConstrainMode constrainMode_, ViewportMode viewportMode_) - : bounds(LatLngBounds::unbounded()) - , constrainMode(constrainMode_) - , viewportMode(viewportMode_) -{ -} + : bounds(LatLngBounds()), constrainMode(constrainMode_), viewportMode(viewportMode_) {} #pragma mark - Matrix |