svgdotjs / svg.js

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

how to move and rotate together ? #1284

Closed echolove38 closed 1 year ago

echolove38 commented 1 year ago

I make a demo here https://codepen.io/echolove38/pen/jOxoQpK I want to the rect rotate and move together, like a car tire. but the rotate center don't change.

HenrySkup commented 1 year ago

Please ask these types of questions on Stack Overflow...

But to answer your question :

Note: Groups do not have a geometry of their own, it's inherited from their content. Therefore groups do not listen to x, y, width and height attributes. If that is what you are looking for, use a nested() svg instead.

https://svgjs.dev/docs/3.0/container-elements/#svg-g