Permalink
Browse files

Fix Jordans change:y bug that gets fired even when vertical is disabled

  • Loading branch information...
koenbok committed Jan 27, 2016
1 parent eb1315d commit 0660faafe008880e67200d65d5da0bb5dc97ad18
Showing with 6 additions and 5 deletions.
  1. +6 −5 framer/LayerDraggable.coffee
@@ -177,9 +177,8 @@ class exports.LayerDraggable extends BaseClass
# See if horizontal/vertical was set and set the offset
point = @layer.point
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))
point.x = @_layerStartPoint.x + (event.offset.x * (1 / @layer.canvasScaleX() * @layer.scale * @layer.scaleX)) if @horizontal
point.y = @_layerStartPoint.y + (event.offset.y * (1 / @layer.canvasScaleY() * @layer.scale * @layer.scaleY)) if @vertical
# Constraints and overdrag
point = @_constrainPosition(point, @_constraints, @overdragScale) if @_constraints
@@ -195,8 +194,8 @@ class exports.LayerDraggable extends BaseClass
# Pixel align all moves
if @pixelAlign
point.x = parseInt(point.x)
point.y = parseInt(point.y)
point.x = parseInt(point.x) if @horizontal
point.y = parseInt(point.y) if @vertical
# Update the dragging status
if point.x isnt @_layerStartPoint.x or point.y isnt @_layerStartPoint.y
@@ -447,6 +446,8 @@ class exports.LayerDraggable extends BaseClass
_onSimulationStop: (axis, state) =>
return if axis is "x" and @horizontal is false
return if axis is "y" and @vertical is false
return unless @_simulation
# Round the end position to whole pixels

0 comments on commit 0660faa

Please sign in to comment.