visionmedia / move.js

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

Prevent exponential notation (e.g. 1.0e-19) reaching CSS #77

Open axelpale opened 8 years ago

axelpale commented 8 years ago

Safari and Opera do not yet support scientific number notation in CSS. In JS, when very small numbers are converted to string, we usually end up with something like "-8.43858185037473e-19".

These unsupported number strings can reach this._transforms within Move.js, corrupting the resulting transformation.

For example, in my project, the following transformation string did not work in Safari 9.0.2:

"matrix(-8.43858185037473e-19, -0.003906249999999999, 0.003906249999999999, -8.43858185037473e-19, -1.3819999999999997 ,0.5000000000000001)"

There is some discussion how to prevent this.