Re: [svg-developers] Drag group of elements and line end
- 2009/3/8 David Leunen <leunen.d@...>:
> Hey,No, I did not know about the SVGPathElement. There are just too many
> The only solution I can think
>> of when using a path is to perform some string replacements on the 'd'
>> attribute (locate the 'M' command, change the points). Something which
>> isn't very clean. Is there any other way to just replace the 'M' command?
> Yes there is. Are you aware of the SVGPathElement?
> You can get its pathSegList and modify it without having to parse the 'd'
> attribute yourself.
options :-S Many thanks, that was what I was looking for.
>What I meant was having the option in SVG to say: This path point
>> The second issue is getting the path element in the first place. I take
>> it there's no easier way then to a) give each line a special 'id', one
>> which can be determined by the 'id' of the car group or b) add both the
>> car group and the path to a second group and walk the DOM until it finds
>> a path in the same group as the car group. Too bad SVG doesn't support
>> some kind of snapping behaviour ;-)
> What do you mean exactly ?
should always be attached to this path/location of this element. This
way, not matter what happens to the element the path point is attached
to, the point will always move along with the element. You wouldn't
have to do it manually any more.