Loading ...
Sorry, an error occurred while loading the content.

Re: [svg-developers] Drag group of elements and line end

Expand Messages
  • Age Bosma
    ... No, I did not know about the SVGPathElement. There are just too many options :-S Many thanks, that was what I was looking for. ... What I meant was having
    Message 1 of 5 , Mar 10 5:19 AM
    • 0 Attachment
      2009/3/8 David Leunen <leunen.d@...>:
      > Hey,
      >
      >
      > 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?
      > http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathElement
      > http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGOMPathElement.html
      > You can get its pathSegList and modify it without having to parse the 'd'
      > attribute yourself.
      >

      No, I did not know about the SVGPathElement. There are just too many
      options :-S Many thanks, that was what I was looking for.

      >
      >
      >
      >> 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 ?

      What I meant was having the option in SVG to say: This path point
      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.

      Age
    Your message has been successfully submitted and would be delivered to recipients shortly.