Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

fix #8300 flyTo for close points #9199

Merged
merged 1 commit into from
Jun 6, 2017
Merged

fix #8300 flyTo for close points #9199

merged 1 commit into from
Jun 6, 2017

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Jun 6, 2017

The isClose threshold is switched from 0.000001 pixels to 1 pixel. As a backup, it checks whether r0 and r1 are finite. It might be possible to have just the threshold check or just the finiteness check, but I don't see the harm in having both.

The std::abs(w0 - w1) < 0.000001 special case is removed because it doesn't look like it's needed. All calculations should run fine even if w0 == w1. I'm fairly confident in this, but if we want to be on the safe side I can add it back in.

Finally, the point interpolation is tweaked so that at the end of the flying (when k === 1) it ends up at the exact end point. I didn't see any bugs related to this, but it seems like a good thing to have explicitly.

@jfirebaugh

The isClose threshold is switched from 0.000001 pixels to 1 pixel.
As a backup, it checks whether r0 and r1 are finite. It might be
possible to have just the threshold check or just the finiteness check,
but I don't see the harm in having both.

std::abs(w0 - w1) < 0.000001 is removed because it doesn't look like
it's needed. All calculations should run fine even if w0 === w1.

Finally, the point interpolation is tweaked so that at the end of the
flying (when k === 1) it ends up at the exact end point. I didn't see
any bugs related to this, but it seems like a good thing to have
explicitly.
@ansis ansis requested a review from jfirebaugh June 6, 2017 19:55
@ansis ansis merged commit c878f5f into master Jun 6, 2017
@jfirebaugh jfirebaugh deleted the fix-8300-flyto branch June 6, 2017 20:34
@kkaefer
Copy link
Member

kkaefer commented Jun 7, 2017

Could we please add a test for this?

LukasPaczos added a commit that referenced this pull request Jul 8, 2019
…ring camera animation

The changes introduced in #9199 changed the minimum required pixel distance between start and end points to >= 1px in order to interpolate, which in scenarios of big zoom changes and low pixel density can result in animation to the previous position and then a jump to the target.
LukasPaczos added a commit that referenced this pull request Jul 9, 2019
…ring camera animation

The changes introduced in #9199 changed the minimum required pixel distance between start and end points to >= 1px in order to interpolate, which in scenarios of big zoom changes and low pixel density can result in animation to the previous position and then a jump to the target.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants