svgdotjs / svgdotjs.github.io

Documentation and website for SVG.js
http://svgjs.dev
Other
13 stars 23 forks source link

Morphables #70

Closed Fuzzyma closed 3 months ago

Fuzzyma commented 5 years ago

In the new version objects do not morph themselves anymore. There is no morph method. Instead all morphables have a to method which returns a new Morphable. This returned object manages the morph. It has an at function to give back a morphed value.

To be morphable, an object needs to implement the method toArray. Beside that, it has to have an init method which at least accepts an array as input.

Morphables are:

Morphable.js extends all Morphable types with a fromArray method and the to method.