Permalink
Browse files

Fix for https://github.com/motif/company/issues/648

  • Loading branch information...
Koen Bok
Koen Bok committed Oct 26, 2015
1 parent 42b7a4b commit 8c8bac45f4d4f9ea017e97f19e670e88acc9bf6d
Showing with 15 additions and 3 deletions.
  1. +15 −3 framer/Animation.coffee
View
@@ -101,12 +101,24 @@ class exports.Animation extends EventEmitter
console.warn "Animation: nothing to animate, all properties are equal to what it is now"
return false
# If this animation wants to animate a property that is already being animated, it stops
# that currently running animation. If not, it allows them both to continue.
for property, animation of @_target.animatingProperties()
if @_stateA.hasOwnProperty(property)
# We used to ignore animations that tried animation already animating properties
# console.warn "Animation: property #{property} is already being animated for this layer by another animation, so we bail"
animation.stop()
# We also need to account for derivatives from x, y
if property is "x" and (
@_stateA.hasOwnProperty("minX") or
@_stateA.hasOwnProperty("midX") or
@_stateA.hasOwnProperty("maxX"))
animation.stop()
# But after some consideration, we actually just stop the animation that is animation those properties for this one
if property is "y" and (
@_stateA.hasOwnProperty("minY") or
@_stateA.hasOwnProperty("midY") or
@_stateA.hasOwnProperty("maxY"))
animation.stop()
if @options.debug

0 comments on commit 8c8bac4

Please sign in to comment.