diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index c272f66a0a6..5b1f97f4d57 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -243,8 +243,8 @@ void Transform::flyTo(const CameraOptions &camera, const AnimationOptions &anima // When u₀ = u₁, the optimal path doesn’t require both ascent and descent. bool isClose = std::abs(u1) < 0.000001; - // Perform a more or less instantaneous transition if the path is too short or zoom out factor is inf. - if ((isClose && std::abs(w0 - w1) < 0.000001) || isinf(r(0))) { + // Perform a more or less instantaneous transition if the path is too short or zoom in/out factor is infinte + if ((isClose && std::abs(w0 - w1) < 0.000001) || std::isinf(r(0)) || std::isinf(r(1))) { easeTo(camera, animation); return; }