Re: 'marker-segment' and distance + 'marker-pattern' + 'marker'

On Nov 22, 2012, at 7:37 AM, Dirk Schulze <dschulze@adobe.com> wrote:

> Hi SVG WG,
> 
> I think 'marker-segment' should have the same syntax as 'marker-pattern' and allow a distance. Often you want to position markers on the corners of a path (even the example for marker-segement does it for demonstration ;)).
> 
> <percentage> would be relative to the segment length, <length> is a distance from the start of a segment.
> 
> 	marker-segment: none | [ <url> <distance>+ ]+
> 
> Multiple markers on the same position should be possible. This can have some neat affects. Markers are drawn by the order. First all markers of the first sequence, then all markers of the next sequence and so on. It must be clarified what happens with negative values.

Looking at it more, I would not allow negative values. Percentage values should not be bigger then 100%. If the distance does not follow this rule, the current pattern/segment sequence is ignored and the parser continues with the next pattern/segment sequence. Segments and patterns should not be allowed to paint beyond the path end. The UA must make sure of that. I am not sure if it makes sense for segments pattern to get into the next segment (a length value was specified that is longer then the segment length), but it might not cause damage.

> 
> 
> This would cause problems with the shorthand 'marker'. But the current syntax is not valid for shorthands anyway. To solve this problem, I would suggest the following syntax:
> 
> 	marker: <marker-tripple> [, <marker-pattern>[, <marker-segment>] ]

The syntax was incomplete:

	marker: <marker-tripple> [, <marker-pattern> [, <marker-segment>]? ]?


> 	marker-pattern: <marker-pattern>
> 	marker-segment: <marker-segment>
> 
> with:
> 	<marker-tripple> = [none | <url>]{1,3} - marker-start, marker-middle and marker-end as in SVG 1.1. If a url is missing, the value gets resolved to none.
> 	<marker-segment> = none | [<url> <distance>+]+
> 	<pattern-segment> = none | [<url> <distance>+]+
> 	<distance> = <length> | <percentage>
> 
> If you want to specify just segments with the shorthand instead of 'marker-segment', you would need to do: "none, none, url(#marker) 20% url(#marker2) 40%". But I think this is reasonable. The shorthand is just useful if you want to specify more then one marker solution (combination of pattern and segment).

This would allow to specify old markers, marker-pattern and marker-segment at the same time. The paint order should be: first marker segments, then marker patterns and start/end/middle marker above the others.

Greetings,
Dirk

> 
> Greetings,
> Dirk

Received on Saturday, 24 November 2012 16:43:21 UTC