Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guard for offset edgecase in flyTo #5331

Merged
merged 2 commits into from
Sep 20, 2017
Merged

guard for offset edgecase in flyTo #5331

merged 2 commits into from
Sep 20, 2017

Conversation

mollymerp
Copy link
Contributor

fix #5322

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

src/ui/camera.js Outdated
@@ -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)) {
if (Math.abs(u1) < 0.000001 || isNaN(S) || S === Infinity) {
Copy link
Member

@mourner mourner Sep 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!isFinite(S) could be better here since it also catches -Infinity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed to invert matrix
2 participants