Permalink
Browse files

Fix draggable rounding

  • Loading branch information...
Koen Bok
Koen Bok committed Jan 27, 2016
1 parent ba0f3ad commit 111572b0a642f467736d544b5743f5a57f807efd
Showing with 4 additions and 2 deletions.
  1. +4 −2 framer/LayerDraggable.coffee
@@ -175,9 +175,11 @@ class exports.LayerDraggable extends BaseClass
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
point = @layer.point
point.x += event.delta.x * (1 / @layer.canvasScaleX() * @layer.scale * @layer.scaleX) if @horizontal
point.y += event.delta.y * (1 / @layer.canvasScaleY() * @layer.scale * @layer.scaleY) if @vertical
point.x = @_layerStartPoint.x + (event.offset.x * (1 / @layer.canvasScaleX() * @layer.scale * @layer.scaleX))
point.y = @_layerStartPoint.y + (event.offset.y * (1 / @layer.canvasScaleY() * @layer.scale * @layer.scaleY))
# Constraints and overdrag
point = @_constrainPosition(point, @_constraints, @overdragScale) if @_constraints

0 comments on commit 111572b

Please sign in to comment.