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

Fix/reuse predictions #1

Merged
merged 19 commits into from
Jun 30, 2022
Merged

Fix/reuse predictions #1

merged 19 commits into from
Jun 30, 2022

Conversation

adamwulf
Copy link
Owner

Fixes a number of issues, most of all how predicted points are handled.

  1. a predicted point used to be associated with its estimationUpdateIndex. however, from the documentation this seems to be incorrect, and each predicted point should be handled on its own. all predicted points are appended to the path and only removed when a new concrete point has been added to the path. if other points are only updated, the predictions are maintained.
  2. fixed an issue with the bezier stream incorrectly duplicating an element when it should only be reusing an element in its cache.
  3. lots of tests added, including tests of streams of events, which are replayed with every possible split position
  4. replaying events from the Example app will replay all remaining events in one batch starting from the existing endpoint, if possible
  5. better re-render calculation for the Points view, taking into account the previous bounds of the path
  6. added an event in the Example app to represent the callback from the gesture, so its easy to see which events were batched together
  7. the antigrain smoother takes into account the indexes of the existing path, so that deleted elements can still be marked as having changed from the updated polyline delta
  8. correctly update force/azimuth/altitude along with location in the Polyline
  9. paths are allowed to be marked as complete, even if points are still expecting updates. this is because not all points will receive updates after the final .ended event has been sent

…sumes a prediction, or the stroke is ended. this commit nearly works, but next commit will add a test case where a stroke ends with more predicted points than could be consumed during the stroke.
…will trigger updated point indexes of those removed points, and smoothers should ignore those.
… no longer needed because the input polyline has fewer points than its last version
…lement and also re-appending that element when it shouldn't have, which was causing an element to get duplicated.
@adamwulf adamwulf merged commit cd7fc8c into main Jun 30, 2022
@adamwulf adamwulf deleted the fix/reuse-predictions branch June 30, 2022 19:19
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.

1 participant