Re: SVGPathElement::getPathSegAtLength()

Steve,

At 01:45 PM 5/9/00 -0700, Steve Dickson wrote:
>In the WD of 2000/03/03, section 8.5 describes the SVGPathElement
>interface.  SVGPathElement contains a method getPathSegAtLength() which
>returns the index of the path segment at a fixed distance offset from the
>start of the path.  The index into which list: pathSegList or
>normalizedPathSegList?  

The spec does in fact say that it returns an index into pathSegList.

>
>This is related to an an earlier note in which I noted that there isn't an
>easy or convenient way for the user to specify whether they want to use
>pathSegList or normalizedPathSegList by default when processing
>SVGPathElements.

Sorry I didn't respond to your earlier note.

The user can use either pathSegList or normalizedPathSegList, depending on
their needs. 

pathSegList gives them a view of the path element that aligns one-for-one
with how the element was defined. 

normalizedPathSegList flattens the path element into absolute lines and
cubic beziers so that someone wanting to use the DOM to morph shapes only
has to deal with a handful of primitive segment types. (For example, with
normalized, you don't have to deal with the arc command.)

The implementation needs to keep the two lists synchronized. If you change
pathSegList, and then you look at what is in normalizedPathSegList, your
changes will appear there also. If you change normalizedPathSegList, then
in some circumstances parts of the pathSegList will have to be flattened,
such as when you have an arc command in pathSegList and then attempt to
modify one of the coresponding bezier segments in normalizedPathSegList.

There is still a question pending about what happens if you attempt to
insert a path segment into both lists. Does this raise a DOM exception?
Sorry, no answer yet on that one.

Jon Ferraiolo
SVG Editor
Adobe Systems Incorporated

Received on Tuesday, 9 May 2000 17:10:20 UTC