svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.07k stars 1.08k forks source link

scalling problem with origin #1255

Closed patson12 closed 2 years ago

patson12 commented 2 years ago

i want to scale svg scalling is working fine.. but i want my top origin fixed .. but after applyying scalling , its happen with centre,, i dont want the position of top changed.. same i want from bottom.. rightnow its working fine with centre..

thanks in advance ...

here is my code

element.transform({

  scaleY: perc ,  
  translate: [0 , 0],
  origin : [0 , 0]
})
Fuzzyma commented 2 years ago

Try origin: 'top left'. But [0,0] should work as well if your element is positioned at 0,0

patson12 commented 2 years ago

thank you ok got it..and now its working fine.. but can i apply animation with scale? i want it like scale work with animation slow or fast..

thanks

Fuzzyma commented 2 years ago

just use animate().transform(). Please post such questions on stackoverflow where more people can easily answer your questions. This is an issue tracker and not meant for support questions. We also have a great documentation https://svgjs.dev :)