Skip to content

Commit

Permalink
use isFinite
Browse files Browse the repository at this point in the history
  • Loading branch information
Molly Lloyd committed Sep 20, 2017
1 parent 8188af2 commit a8b91a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ class Camera extends Evented {
let S = (r(1) - r0) / rho;

// When u₀ = u₁, the optimal path doesn’t require both ascent and descent.
if (Math.abs(u1) < 0.000001 || isNaN(S) || S === Infinity) {
if (Math.abs(u1) < 0.000001 || !isFinite(S)) {
// Perform a more or less instantaneous transition if the path is too short.
if (Math.abs(w0 - w1) < 0.000001) return this.easeTo(options, eventData);

Expand Down

0 comments on commit a8b91a0

Please sign in to comment.