diff options
author | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-03-07 15:43:06 +0200 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-03-14 18:33:11 +0200 |
commit | a73cc9d8e363b0b3f4fa66c5d9c34625dffbb7e5 (patch) | |
tree | ad0b4cd4349a17a8f4c3bc6ec9f5bbbf0c25f1dd /src/mbgl/map/transform.cpp | |
parent | dba40c64ea8175b5dbf1cd043b3bc40730e13956 (diff) | |
download | qtlocation-mapboxgl-a73cc9d8e363b0b3f4fa66c5d9c34625dffbb7e5.tar.gz |
[core] Remove support for setting minimum and maximum pitch
Support for limiting pitch was introduced in commit c4fc89977bcb ([core]
Added {set,get}{Min,Max}Pitch) in 2017 but was never exposed by the
platform SDKs. Simplify the Map interface by removing this unused
feature.
v2: Add util::PITCH_MIN
Diffstat (limited to 'src/mbgl/map/transform.cpp')
-rw-r--r-- | src/mbgl/map/transform.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index e60ce7a1bd..a90bf9871f 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -116,7 +116,7 @@ void Transform::easeTo(const CameraOptions& camera, const AnimationOptions& anim // Constrain camera options. zoom = util::clamp(zoom, state.getMinZoom(), state.getMaxZoom()); const double scale = state.zoomScale(zoom); - pitch = util::clamp(pitch, state.min_pitch, state.max_pitch); + pitch = util::clamp(pitch, util::PITCH_MIN, util::PITCH_MAX); // Minimize rotation by taking the shorter path around the circle. bearing = _normalizeAngle(bearing, state.bearing); @@ -181,7 +181,7 @@ void Transform::flyTo(const CameraOptions &camera, const AnimationOptions &anima // Constrain camera options. zoom = util::clamp(zoom, state.getMinZoom(), state.getMaxZoom()); - pitch = util::clamp(pitch, state.min_pitch, state.max_pitch); + pitch = util::clamp(pitch, util::PITCH_MIN, util::PITCH_MAX); // Minimize rotation by taking the shorter path around the circle. bearing = _normalizeAngle(bearing, state.bearing); @@ -361,16 +361,6 @@ void Transform::setMaxZoom(const double maxZoom) { state.setMaxZoom(maxZoom); } -void Transform::setMinPitch(double minPitch) { - if (std::isnan(minPitch)) return; - state.setMinPitch(minPitch); -} - -void Transform::setMaxPitch(double maxPitch) { - if (std::isnan(maxPitch)) return; - state.setMaxPitch(maxPitch); -} - #pragma mark - Bearing void Transform::rotateBy(const ScreenCoordinate& first, const ScreenCoordinate& second, const AnimationOptions& animation) { |