Re: [svgwg] Serialization format for path strings

> Given that the path data is just a string to the parser, it seems a bit strange to normalize it for getComputedStyle.

When we are animating, we have to choose a format. It is reasonable for the format to be specified by the standard.
 
The normalizedPathSegList [normalization](https://svgwg.org/specs/paths/#InterfaceSVGPathDataSettings)

> if normalize is set to true then the returned sequence of path segments is converted to the base set of absolute commands ('M', 'L', 'C' and 'Z'), with the values adjusted accordingly.

gives a precedent for normalizing to absolute instead of relative coordinates.
 
I agree with Amelia's preference against normalising arcs to straight lines.
 
A new normalization proposal is required, perhaps the following:-
 
 

> All relative commands are normalized to the equivalent absolute commands.
>  
> When animating paths using CSS, interpolation is possible provided the paths have the same number of commands, and the corresponding path segments have the same types and numbers of arguments after any necessary promotion.
>  
> Given current point (cx, cy), we define promotions
> H/V -> L -> Q -> C
> as follows:
>  
> H x -> L x cy
> V x -> L cx y
> L x y -> Q  (cx + x)/2  (cy + y)/2  x y
> Q  (x1 y1 x y)+  -> C  (x1 y1 x1 y1 x y)+
> 

Thus H, V and Q can appear in getComputedStyle results, but animation from H to V would result in L, and animation from V to C would result in C.
 


-- 
GitHub Notification of comment by ewilligers
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/321#issuecomment-304558613 using your GitHub account

Received on Monday, 29 May 2017 02:17:34 UTC