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"

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.
"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

Received on Friday, 3 September 2010 18:38:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:45 UTC