--- In [email protected], "pete.haikonen"
<[EMAIL PROTECTED]> wrote:
>
> Dear list,
> 
> say I have a path:
> <path d="M 1 2 C 3 4 5 6 7 8" />
> 
> i.e. 4 curve points. Please, how do I change the position of a point?
> In Javascript? One way is to rebuild the "d" attribute and re-assign
> it but there has (?) to be another way?
> 
> Thanks in advance!
>

Let's say you have a javascript variable 'path' which is a pointer to
the path element. Then by calling
var moveto = path.pathSegList.getItem(0);
you can retrieve the initial SVGPathSegMovetoAbs object. Changing its
attributes
moveto.x and moveto.y
moves the first point of the path.
var curve = path.pathSegList.getItem(1);
gives you the SVGPathSegCurvetoCubicAbs object. Changing
curve.x and curve.y would move the curve's end point.
The control points can be moved by changing
curve.x1 and curve.y1, and
curve.x2 and curve.y2.

It's specified in
http://www.w3.org/TR/SVG11/paths.html#DOMInterfaces

note that the interface SVGPathElement, representing path elements,
inherits from the interface SVGAnimatedPathData.


------------------------------------

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to