visionmedia / move.js

CSS3 backed JavaScript animation framework
http://visionmedia.github.com/move.js/
4.72k stars 686 forks source link

transforms should not be cloned on then #67

Closed bruce-lindsay closed 5 years ago

bruce-lindsay commented 9 years ago

When calling "then", the transforms are being cloned. This results in the following code not functioning properly when run with the markup from /examples/transform.html.

move('#square').rotate(300).duration('2s').then().rotate(0).duration('1s').pop().end()

expected the square should transition to the 300 degree rotation over 2 seconds then return to 0 degree rotation over 1 second. actual the square transitions to 300 degree rotation over 2 seconds but the style property is set to rotate(300deg); rotate(0deg) when the 1s transition executes.

bruce-lindsay commented 9 years ago

I think there is a deeper issue with the transforms handling. Although this accomplishes a fix for one use case it doesn't fix the following (which is an issue in both my PR and current master 5299f9d4bcf242c2f3e7ced11a0b1fe6dea0ca27)

move('#square')
  .rotate(180)
  .scale(.5)
  .end(function(){
    move('#square')
      .rotate(0)
      .end();
      });

expected object is scaled at .5 with no rotation after the second animation ends. actual object is no longer scaled

Closing PR.

bruce-lindsay commented 9 years ago

New commit works for both use cases. :smiley: