W3C home > Mailing lists > Public > www-svg@w3.org > November 2012

Re: marker-pattern syntax

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 30 Nov 2012 17:27:00 +1100
Message-ID: <50B851B4.8000305@mcc.id.au>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Dirk Schulze <dschulze@adobe.com>, SVG public list <www-svg@w3.org>
We spoke a bit about marker-pattern in the telcon today (before the 
power outage interrupted us).  Nobody expressed any concerns about being 
able to write multiple tracks, so I think we have agreement on adding 
that.  We didn't come up with any new syntactic solutions for specifying 
offsets and delimiting the marker pattern from them, so we can continue 
trying to work that out here.

One thing that Dirk pointed out was that my idea of an offset was 
different from his.  Dirk imagined that the offset behaved like 
stroke-dashoffset, i.e. it allows you to specify an initial non-zero 
position within the repeated path.  I was thinking of it as modifying 
the length and position of the path that gets a marker pattern applied 
to it.  If we wrote (assuming the syntax where the offset is before the 
pattern):

   marker-pattern: 10px url() 20px;

then you would get a marker pattern like (each character is 5px wide):

   --X---X---X---X---X

with both interpretations of "offset".  It would make a difference 
though if you had, say:

   marker-pattern: 50% url() 50%;

The former interpretation would result in:

   X-------X-------X

and the latter in either:

   --------X-------X

or

   --------X---X---X

depending on whether the percentage in the pattern resolves against the 
path length before or after adjusting for the offset.

My feeling is that these two meanings of offset cater to different use 
cases:

* the former interpretation is for sliding the marker pattern so that it 
looks nicer at the start of the path

* the latter interpretation is for ensuring that the marker pattern 
isn't painted at the start/end vertices of the path (since they might 
otherwise collide with other markers or graphics there)

The idea of an offset at the end of the path obviously only makes sense 
with the second interpretation.

IMO both are useful and we should try to accommodate them both in the 
syntax.  I have no concrete suggestions for doing that yet.
Received on Friday, 30 November 2012 06:28:35 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:53 GMT