This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Ensure consistent willChange/didChange callbacks - #3086
Merged
Merged
Conversation
This was referenced Nov 20, 2015
Contributor
|
If you would consider this bug fixes @1ec5, please move to 3.0.1 milestone since that's definitely happening, otherwise we can hit it later in 3.1.0 with some other features. |
Coalescing willChange/didChange notifications means keeping track of how many gestures are currently in progress; a boolean isn’t enough to track this state. This change refactors the gesture recognizers, making them more consistent with each other and more consistent in the case where more than one of them has fired. It also explicitly cancels transitions before all programmatic viewport-modifying methods, since mbgl only does so when animating. Fixes #2313, fixes #2379, fixes #3062.
1ec5
force-pushed
the
1ec5-did-change-after-changing-3062
branch
from
November 25, 2015 22:39
9370290 to
e3992c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coalescing willChange/didChange callbacks means keeping track of how many gestures are currently in progress; by contrast, tracking this state with a boolean opens the door to many race conditions. This change refactors the gesture recognizers, making them more consistent with each other, more consistent in the case where more than one of them has fired, and a whole lot easier to reason about. It also explicitly cancels transitions before all programmatic viewport-modifying methods, since mbgl only does so when animating.
Two behavioral changes result from this PR:
This PR also updates the tests to rely on didChange callbacks instead of timers. It wasn’t possible to do so before, because didChange would be called immediately after willChange (and before any animation) about half the time. This change should prevent the rotation test cases from flip-flopping going forward.
Fixes #2204, fixes #2313, fixes #2379, fixes #3062. Related to #2775.
/cc @friedbunny @incanus