diff options
Diffstat (limited to 'src/mbgl/map/transform.cpp')
-rw-r--r-- | src/mbgl/map/transform.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index dac4018627..b932c8cb38 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -71,7 +71,7 @@ void Transform::easeTo(const CameraOptions& options) { LatLng latLng = easeOptions.center ? *easeOptions.center : getLatLng(); double zoom = easeOptions.zoom ? *easeOptions.zoom : getZoom(); double angle = easeOptions.angle ? *easeOptions.angle : getAngle(); - if (!latLng.isValid() || std::isnan(zoom) || std::isnan(angle)) { + if (!latLng || std::isnan(zoom) || std::isnan(angle)) { return; } @@ -94,7 +94,7 @@ void Transform::easeTo(const CameraOptions& options) { } void Transform::moveBy(const PrecisionPoint& point, const Duration& duration) { - if (!point.isValid()) { + if (!point) { return; } @@ -113,7 +113,7 @@ void Transform::_moveBy(const PrecisionPoint& point, const Duration& duration) { } void Transform::setLatLng(const LatLng& latLng, const Duration& duration) { - if (!latLng.isValid()) { + if (!latLng) { return; } @@ -124,7 +124,7 @@ void Transform::setLatLng(const LatLng& latLng, const Duration& duration) { } void Transform::setLatLng(const LatLng& latLng, const PrecisionPoint& point, const Duration& duration) { - if (!latLng.isValid() || !point.isValid()) { + if (!latLng || !point) { return; } @@ -145,7 +145,7 @@ void Transform::setLatLng(const LatLng& latLng, const PrecisionPoint& point, con } void Transform::setLatLngZoom(const LatLng& latLng, double zoom, const Duration& duration) { - if (!latLng.isValid() || std::isnan(zoom)) { + if (!latLng || std::isnan(zoom)) { return; } @@ -160,7 +160,7 @@ void Transform::setLatLngZoom(const LatLng& latLng, double zoom, const Duration& #pragma mark - Zoom void Transform::scaleBy(const double ds, const PrecisionPoint& center, const Duration& duration) { - if (std::isnan(ds) || !center.isValid()) { + if (std::isnan(ds) || !center) { return; } @@ -176,7 +176,7 @@ void Transform::scaleBy(const double ds, const PrecisionPoint& center, const Dur } void Transform::setScale(const double scale, const PrecisionPoint& center, const Duration& duration) { - if (std::isnan(scale) || !center.isValid()) { + if (std::isnan(scale) || !center) { return; } @@ -306,7 +306,7 @@ void Transform::_easeTo(const CameraOptions& options, double new_scale, double n #pragma mark - Angle void Transform::rotateBy(const PrecisionPoint& first, const PrecisionPoint& second, const Duration& duration) { - if (!first.isValid() || !second.isValid()) { + if (!first || !second) { return; } @@ -346,7 +346,7 @@ void Transform::setAngle(const double new_angle, const Duration& duration) { } void Transform::setAngle(const double new_angle, const PrecisionPoint& center) { - if (std::isnan(new_angle) || !center.isValid()) { + if (std::isnan(new_angle) || !center) { return; } |