Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SVG A element not move according its parent #1110

Closed
amanfrinati opened this issue May 19, 2020 · 3 comments
Closed

The SVG A element not move according its parent #1110

amanfrinati opened this issue May 19, 2020 · 3 comments

Comments

@amanfrinati
Copy link

Bug report

I need to create an SVG A element into a group element and move the group according another coordinate system, but this feature seems like not work on svg.js version 3.0.16.

Fiddle

This code running in version 2.7.0 https://jsfiddle.net/amanfrinati/oj26zm9b/9/: in this snippet, the red square was move on (200, 200) moving the granfather g1.

Here https://jsfiddle.net/amanfrinati/n953op7u/6/ the same snippet running in svg.js@3.0.16 not working.

Explanation

  • I expected that the red square was move to point (200, 200)
  • The red square stay on the same position
@Fuzzyma
Copy link
Member

Fuzzyma commented May 19, 2020

Good catch. <a> should behave the same as <g>. The reason it worked in 2.x is because groups got translated when you used move(). This is handled differently in 3.x. You can use the old behavior by explicitely translating the group:

grp.translate(200, 200)

@amanfrinati
Copy link
Author

Ok! This solve it!

@gntyu
Copy link

gntyu commented Oct 26, 2021

well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants