Skip to content

Commit

Permalink
Fix draggable.momentum, less momentum tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbok committed Apr 7, 2015
1 parent 64896a8 commit e6d5cda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion framer/Defaults.coffee
Expand Up @@ -27,7 +27,7 @@ Originals =
momentum: true
momentumOptions:
friction: 2.1
tolerance: 10
tolerance: 1
bounce: true
bounceOptions:
friction: 40
Expand Down
9 changes: 8 additions & 1 deletion framer/LayerDraggable.coffee
Expand Up @@ -467,8 +467,15 @@ class exports.LayerDraggable extends BaseClass

_startSimulation: ->

# The types of simulation that we can have are:
# 1) Momentum inside constraints
# 2) Momentum inside constraints to outside constraints bounce
# 3) Release outside constraints bounce
# 4) Momentum without constraints

return unless @momentum or @bounce
return if @isDragging is false and @isBeyondConstraints is false
return if @isBeyondConstraints is false and @momentum is false
return if @isBeyondConstraints is false and @isDragging is false

# If overdrag is disabled, we need to not have a bounce animation
# when the cursor is outside of the dragging bounds for an axis.
Expand Down

0 comments on commit e6d5cda

Please sign in to comment.