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

Prevent rounding bug in LayerDraggable #517

Merged
merged 2 commits into from Jun 15, 2017
Merged

Prevent rounding bug in LayerDraggable #517

merged 2 commits into from Jun 15, 2017

Commits on Jun 13, 2017

  1. Prevent rounding bug in LayerDraggable

    A colleague recently discovered a bug that caused draggable layers with constraints to incorrectly animate to a slightly different position that specified. The bug can be reproduced using the following code: https://gist.github.com/daneden/f5a0826168ea9626af3091d5b08c7911
    
    Dragging the layer `myCard` up causes it to return to position `y: 89` instead of `y: 90`. This PR addresses the issue by using `Math.round` instead of `parseInt` to ensure the layer is returned to the correct constraint.
    
    ```js
    > parseInt(8.999)
      9
    > Math.round(8.999)
      8
    ```
    daneden committed Jun 13, 2017
    Configuration menu
    Copy the full SHA
    cf67835 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2017

  1. Configuration menu
    Copy the full SHA
    e684e93 View commit details
    Browse the repository at this point in the history