Andres Toussaint wrote:
Yah, I would be tempted to have an extra bit that indicates if the
segment should be normalized before returning it.
I am not clear as to what you mean by the "extra bit". What would be the
purpose? According to the SVG Spec, all types of path options should be
normalized to the appropriate instance of the subset. This is:
Relative Moveto (m), Lineto(l), CurvetoCubic(c) --to--> Absolute
Moveto(M), Lineto(L) or
CurvetoCubic(C)
Sorry I was reading it quickly and thought that the basic
normalization was from relative to absolute. Not that you needed
to change the basic element types.
Relative or Absolute Horizontal and Vertical Lineto (H,h,V,v) --to-->
Absolute Lineto(L)
Relative or Absolute Smooth CurvetoCubic (S,s) --to--> Absolute
CurvetoCubic (C)
Absolute or Relative CurvetoQuadratic (Q,q,T,t) --to--> Absolute
sequence of Lineto segments (L)+
Are you sure about this? I would naturally promote the
quadratic to a cubic by adding a duplicate control point, this
avoids loss of precision but would seem to comply with the subset
of segments requirement.
Absolute or Relative Arc (A,a) --to--> Absolute sequence of Lineto
segments (L)+
I notice the example in the spec text but I wonder if this
was really thought through, once again the _much_ more common
thing would be to replace the arc with cubic curves (one per
quadrant of the ellipse).
The spec states:
"Modifications to normalizedPathSegList might cause entries in
pathSegList to be broken into a set of normalized path segments."
So to my understanding, we need to track if the pathSegList resulting
from a normalizedPathSegList call is modified, then the standard
pathSegList will be replaced by the normalized one, with the changes.
But I am also at a loss in the interpretation, since the spec also
states that *animatedNormalizedPathSegList *is a readOnly property, so
the option of changing values shoudl not be allowed.
You need to be careful when a property is read only it means you
can't assign something to it but it does not mean that the object
returned is read only. So you can't change the actual PathSegList
but you can completely replace the path seg list's contents
(using replaceItem, etc).
The Arc is simple you simply need to make the destination point
an absolute point rather than a relative one. There is no way to
normalize the radii or the arc flags (or they are already normalized).
/I understand from the spec that the ARC should be normalized into a
Flattened Curve, i.e. a series of Lineto (L) that approximate the arc.
/Also, arising from this, one item that is unclear is where and how to
define the flatness threshold for normalizing, i.e. how accurate the
conversion of the curve to lines is. This is usually a double value that
indicates the distance allowed from the tangent to the curve until you
need a next point. The spec has no clear reference to this item.
Yes, without a flattening parameter it is impossible to do this
properly (and even with it, the result is ugly). It would be much
better to use cubic curves (still not perfect but much better).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]