CreateJS / TweenJS

A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.
http://createjs.com/
MIT License
3.56k stars 967 forks source link

Use javascript functions to parse CSSStyle values and remove regex #115

Open DH1994 opened 9 months ago

DH1994 commented 9 months ago

Added this to prevent failures when values have an exponent. For example: 3.4324e-8 will not be parsed with the current CSSPlugin. To prevent failures for transforms, I've rewritten the parseTransform and writeTransform functions to use CSSStyleValue.parse.

danzen commented 9 months ago

Hi Dennis - thanks for the work on this. A couple questions:

  1. Could you not have tested for this type of input and converted then passed the value in to the original code?

  2. I do not do much animation of CSS - can you link to a few tests that you did as a starting point so I can check it over more easily. Thanks.

Dan

DH1994 commented 9 months ago

Hi Dennis - thanks for the work on this. A couple questions:

  1. Could you not have tested for this type of input and converted then passed the value in to the original code?
  2. I do not do much animation of CSS - can you link to a few tests that you did as a starting point so I can check it over more easily. Thanks.

Dan

Hi Dan,

  1. Yes, I added a example with moves in the examples dir to test values without unit (opacity) now.

  2. In the example a square is moving from left to right. With the original code, the square only moves back and forth the first time. After the first position changes it didn't move anymore, because the value couldn't be parsed anymore. This is fixed.