svgdotjs / svgdotjs.github.io

Documentation and website for SVG.js

Home Page:http://svgjs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Matix has a few more methods

Fuzzyma opened this issue · comments

As stated in #63 the new transforms are based on the Matrix transform function.
Matrix also has a transform method which works the same as stated in #63. You can even pass an affine transform object into the Matrix constructor. new Matrix({translate: [100, 200]})...

Beside that, the following methods where added:

  • lmultiply
  • compose(obj) (not sure if this one is needed. @saivan - wasnt that the same as creating a new matrix woth obj?)
  • decompose (cx = 0, cy = 0)
  • shear
  • toArray

And then you have a lot of optimized functions which all end with O like translateO and rotateO which do not create a new Matrix but instead reuse the current one. That really speeded up animation code (1000 of new objects every frame is not that good)