Skip to content

Ensure smooth snap line display#3514

Merged
swissspidy merged 4 commits intodevelopfrom
fix/3458-smooth-snaplines
Oct 16, 2019
Merged

Ensure smooth snap line display#3514
swissspidy merged 4 commits intodevelopfrom
fix/3458-smooth-snaplines

Conversation

@barklund
Copy link
Copy Markdown
Contributor

@barklund barklund commented Oct 15, 2019

Summary

Optimizes snap line display while dragging elements on a page with multiple other elements.

Fixes #3458.

Todo

  • Debounce the snap line setter by 10 ms to ensure smoother snap line display.

  • Split snap targets in edge targets and center targets and calculate potential snap lines for each separately.

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

Debounce the snap line setter by 10 ms to ensure smoother snap line display. This both ensures that the mouse move handler returns quickly (by moving the actual update to a background `setTimeout` call) and also ensure that multiple updates within a short timeframe don't cause multiple short-lived renders.
@barklund barklund self-assigned this Oct 15, 2019
@googlebot googlebot added the cla: yes Signed the Google CLA label Oct 15, 2019
@barklund barklund marked this pull request as ready for review October 15, 2019 16:01
Copy link
Copy Markdown
Collaborator

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

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

Nice work!

@swissspidy swissspidy added this to the v1.3.1 milestone Oct 16, 2019
@swissspidy swissspidy merged commit dd40b9c into develop Oct 16, 2019
@swissspidy swissspidy deleted the fix/3458-smooth-snaplines branch October 16, 2019 14:49
@swissspidy swissspidy modified the milestones: v1.3.1, v1.4 Oct 17, 2019
westonruter added a commit that referenced this pull request Oct 18, 2019
…alidation-sourcing

* 'develop' of github.com:ampproject/amp-wp: (57 commits)
  Undo over-eager rename of auto_accept_sanitization
  Rename auto-accept to accept-by-default
  Rename filter to amp_validation_error_auto_sanitized
  Fix jumping blocks when changing fonts (#3529)
  Update dependency browserslist to v4.7.1 (#3551)
  Make sure that isPageBlock always returns boolean.
  Fix and improve e2e tests.
  Remove unnessary check for block. Use shift over access first element of array.
  Use isPageBlock for cleaner code.
  Fix minor grammar issues
  Add docblock for `amp_is_sanitization_auto_accepted` filter
  Align arrows
  Update tests to use filter to set sanitization auto acceptance
  Make AMP_Validation_Manage::is_sanitization_auto_accepted() filterable
  Remove 'auto_accept_sanitization' option
  Remove relevant auto-sanitization notices
  Remove validation handling setting field
  Add special-case handling for layout=fill when both dimensions are 100%
  Insert duplicated page as current page.
  Ensure smooth snap line display (#3514)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Signed the Google CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lag when dragging elements

3 participants