Skip to content

Commit

Permalink
Merge pull request #31 from perrin4869/master
Browse files Browse the repository at this point in the history
Fix start and end values of element properties animation
  • Loading branch information
mv-stripe authored Aug 20, 2016
2 parents 1d4657f + 2f774fb commit a160009
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/dynamics.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ getCurrentProperties = (el, keys) ->
matrix = Matrix.fromTransform(style[propertyWithPrefix('transform')])
properties['transform'] = matrix.decompose()
else
v = style[key]
if key of el # support animating scrollTop, etc
v = el[key]
else
v = style[key]

if (!v? or key is 'd') && svgProperties.contains(key)
v = el.getAttribute(key)
if v == "" or !v?
Expand Down Expand Up @@ -1130,7 +1134,7 @@ startAnimation = (el, properties, options, timeoutId) ->
transforms.push([k, v])
else
interpolable = createInterpolable(v)
if interpolable instanceof InterpolableNumber && el.style?
if interpolable instanceof InterpolableNumber && k not of el && el.style?
interpolable = new InterpolableString([
interpolable,
unitForProperty(k, 0),
Expand Down

0 comments on commit a160009

Please sign in to comment.