W3C home > Mailing lists > Public > public-svg-wg@w3.org > April to June 2008

Re: Normalizing a 'z' or 'Z' command

From: Erik Dahlström <ed@opera.com>
Date: Wed, 07 May 2008 15:49:03 +0200
To: "Alex Danilo" <alex@abbra.com>
Cc: "public-svg-wg@w3.org" <public-svg-wg@w3.org>
Message-ID: <op.uasdz1y1gqiacl@gnorps.palace.opera.no>

Hello Alex,

On Wed, 07 May 2008 13:45:08 +0200, Alex Danilo <alex@abbra.com> wrote:

> Hello Erik,
>
> --Original Message--:
>>
>> Hello public-svg-wg,
>>
>> A question regarding path normalization:
>>
>> - When closing a subpath with the SVGPath.close() method, does it add a
>> LINE_TO if the coordinate of the start doesn't match the end coordinate?
>> The path normalization list doesn't mention this case. It has  
>> implications
>> for both the SVGPath interface and path animation/interpolation[4].
>
> It would be wrong to imply a LINE_TO. The LINE_TO does not imply a line
> join to be formed at the intersection of the starting point and the end
> of the LINE_TO so they are semantically different. The join will be
> formed by a close path.

It's true that a lineto doesn't imply the path is closed (joined).

A close command implies that a lineto is made if the current position  
isn't the same as the starting point of the subpath however.

>> The testcase udom-svgpath-201-t.svg[2] assumes that a lineto is not  
>> added.
>
> Then it's a good test.

I'm not saying it's a bad test, I'm saying the test shows that the spec is  
not clear enough.

>> SVG 1.1 [3] doesn't disallow normalizing a close command as  
>> lineto+close,
>> it only states the set of allowed normalized commands (so even if you
>> wanted to normalize close as curveto+lineto+close you'd be free to do  
>> so).
>>
>> The following two paths are not interpolable[4] if the lineto isn't  
>> added
>> as a normalization step:
>>
>>   <path d="M0 0l10 10z"/>
>>   <path d="M0 0l10 10l-10 -10z"/>
>
> I wouldn't expect those to be interpolable.

Ok.

>> I would like the 1.2T spec to define how close commands should be
>> normalized.
>
> Yes that would be good, but the number of commands in each path
> syntax element should remain equal, the implementation should
> not synthesize extra ones IMO.

It keeps things simpler sure. I'm fine with defining the close command  
being normalized as just the close command. Since it's not clear to me  
 from reading the 1.2T spec that it's not lineto+close then I think it  
would make sense to be explicit about that in the path normalization  
section.

Another thing about the test in question is that it incorrectly requires a  
QUAD_TO to not be normalized, while the spec says it must be normalized to  
a CURVE_TO.

Cheers
/Erik

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Wednesday, 7 May 2008 13:51:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 May 2008 13:51:48 GMT