Navigation Menu

Skip to content

Commit

Permalink
Fix draggable rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Bok committed Jan 27, 2016
1 parent ba0f3ad commit 111572b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framer/LayerDraggable.coffee
Expand Up @@ -175,9 +175,11 @@ class exports.LayerDraggable extends BaseClass
t: Date.now() # We don't use timeStamp because it's different on Chrome/Safari t: Date.now() # We don't use timeStamp because it's different on Chrome/Safari


# See if horizontal/vertical was set and set the offset # See if horizontal/vertical was set and set the offset

point = @layer.point point = @layer.point
point.x += event.delta.x * (1 / @layer.canvasScaleX() * @layer.scale * @layer.scaleX) if @horizontal point.x = @_layerStartPoint.x + (event.offset.x * (1 / @layer.canvasScaleX() * @layer.scale * @layer.scaleX))
point.y += event.delta.y * (1 / @layer.canvasScaleY() * @layer.scale * @layer.scaleY) if @vertical point.y = @_layerStartPoint.y + (event.offset.y * (1 / @layer.canvasScaleY() * @layer.scale * @layer.scaleY))



# Constraints and overdrag # Constraints and overdrag
point = @_constrainPosition(point, @_constraints, @overdragScale) if @_constraints point = @_constrainPosition(point, @_constraints, @overdragScale) if @_constraints
Expand Down

0 comments on commit 111572b

Please sign in to comment.