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

Moving SVG elements #55

Open
GitterHubber opened this issue Dec 11, 2019 · 1 comment
Open

Moving SVG elements #55

GitterHubber opened this issue Dec 11, 2019 · 1 comment

Comments

@GitterHubber
Copy link

I'm trying to move SVG elements around within the SVG, I mean change the position of some elements of a particular class.

I see the x and y position of the SVG elements are reported as 0, why so?
Although getBounds() returns the correct position and size.

When I try setting the x or y properties of the SVG element the element does move but the position is incorrect.

Is there any util that sets position of the SVG elements?

@lucaslorentz
Copy link
Owner

lucaslorentz commented Dec 18, 2019

Several things affect svg elements position, like parent groups, transform matrix, path coordinates and svg properties like x, y.

You should not set x, y directly in svg elements, but use specific svg properties to move it.
For example, if it is a Rect you can set properties SvgX and SvgY to move it.

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

2 participants