Re: percentage values in markerWidth/markerHeight


All the implementations I've tested use the referencing element's
definition of 100% multiplied by the stroke-width.  I don't think it's
particularly useful--I like the idea of treating decimals and percentages
as mathematical equivalents--but it seems to be consistently implemented.

There's a paragraph in SVG 1.1 (and still in SVG 2 if you scroll down) that
sort of defines this behavior:

The contents of the ‘marker’
<> are relative to a
new coordinate system. Attribute ‘markerUnits’
<> determines
an initial scale factor for transforming the graphics in the marker into
the user coordinate system for the referencing element.

In other words, everyone treats `markerUnits="strokeWidth"` (on the marker)
and `strokeWidth="3"` (on the referencing element) as equivalent to
`transform="scale(3)"` on the marker.

But it's not very clear.  Even if we decide that it's easiest to stick with
current behavior, we should probably pave this cow-path with a more
explicit definition.


On 12 March 2015 at 00:09, Cameron McCormack <> wrote:

> In trying to think of ways to rely on a resource document’s default
> viewport size, I wondered about this:
>   <svg xmlns="">
>     <marker id="m" markerWidth="100%" markerHeight="100%">
>       …
>     </marker>
>   </svg>
> The lacuna value of markerUnits is “strokeWidth”, which says that a user
> unit is equal in size to the referencing object’s stroke-width value,
> but it doesn’t say what percentages resolve against.  Probably it makes
> sense to resolve them against the stroke-width value too (so that 0.5 is
> equivalent to 50%), rather than the <svg>‘s viewport size.
> We should test/specify this.
> --
> Cameron McCormack ≝

Received on Friday, 13 March 2015 01:42:56 UTC