AS3SVGRenderer icon indicating copy to clipboard operation
AS3SVGRenderer copied to clipboard

Moving SVG elements

Open GitterHubber opened this issue 5 years ago • 1 comments

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?

GitterHubber avatar Dec 11 '19 13:12 GitterHubber

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.

lucaslorentz avatar Dec 18 '19 18:12 lucaslorentz