W3C home > Mailing lists > Public > www-svg@w3.org > September 2010

normalizedPathSegList in SVGPathElement

From: Dirk Schulze <vbs85@gmx.de>
Date: Fri, 03 Sep 2010 20:38:06 +0200
To: www-svg@w3.org
Message-ID: <1283539086.28494.84.camel@dirk-laptop>
Hi www-svg,

I am working on an implementation for normalizedPathSegList for WebKit.

The normalizedPathSegList should represent the normalized segments of  
a path, transformed from relative to absolute coordinates only
consisting of M, C, L or z path segment types. All other segment types
have to be decomposited to a set of the allowed types.

The specification does not define how a SVGPathSeg should get
transformed to these types. For instance Opera and our version of the
normalized path transforms an arc into a set of cubic curves. That makes
sense, because the deviation to the arc is minimal.

But a hint in the Spec says:
"Thus, if the ‘d’attribute has an "absolute moveto (M)" and an "absolute
arcto (A)" command, then pathSegList will have one
SVG_PATHSEG_MOVETO_ABS entry followed by a series of
SVG_PATHSEG_LINETO_ABS entries which approximate the arc"
(http://www.w3.org/TR/SVG/paths.html#__svg__SVGAnimatedPathData__normalizedPathSegList)

I think normalizedPathSegList is much more useful, if all
implementations create the same normalizedPathSegList, because
pathSegList and normalizedPathSegList need to be synchronized. That
means, if a segment is changed in the normalizedPathSegList, only its
corresponding segment should get replaced by the normalized segments in
the pathSegList.
Spec:
"Modifications to normalizedPathSegList might cause entries in
pathSegList to be broken into a set of normalized path segments."

Can the specification provide a more detailed algorithm how to
flatten/normalize a path, and how to synchronize both types of segment
lists?

Cheers,
Dirk
Received on Friday, 3 September 2010 18:38:41 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:46 GMT