Permalink
Browse files

Merge pull request #517 from daneden/patch-1

Prevent rounding bug in LayerDraggable
  • Loading branch information...
nvh committed Jun 15, 2017
2 parents 582d861 + e684e93 commit 0c93b70c97148b142866262716e9fd329207ae5b
Showing with 3 additions and 3 deletions.
  1. +3 −3 framer/LayerDraggable.coffee
@@ -249,8 +249,8 @@ class exports.LayerDraggable extends BaseClass
# Align every drag to pixels
if @pixelAlign
point.x = parseInt(point.x) if @horizontal
point.y = parseInt(point.y) if @vertical
point.x = Math.round(point.x) if @horizontal
point.y = Math.round(point.y) if @vertical
# While we update the layer position ourselves, we don't want
# to trigger the updater for external changes.
@@ -531,7 +531,7 @@ class exports.LayerDraggable extends BaseClass
return unless @_simulation
# Round the end position to whole pixels
@layer[axis] = parseInt(@layer[axis]) if @pixelAlign
@layer[axis] = Math.round(@layer[axis]) if @pixelAlign
# See if both simulators are stopped
if @_simulation.x.finished() and @_simulation.y.finished()

0 comments on commit 0c93b70

Please sign in to comment.