W3C home > Mailing lists > Public > www-svg@w3.org > February 2010

Re: Feature Request: markerPaint

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Tue, 9 Feb 2010 17:14:39 +0100
To: www-svg@w3.org
Message-Id: <201002091714.39180.Dr.O.Hoffmann@gmx.de>
Jeff Schiller:
>Indeed, currentColor seems like it would meet part of the need:
>
><svg xmlns="http://www.w3.org/2000/svg">
> <defs>
> <marker refX="2" orient="auto" markerHeight="5" markerWidth="5"
>markerUnits="strokeWidth" refY="5" id="arrow" viewBox="0 0 10 10">
>   <path fill="currentColor" d="m10,0l-10,5l10,5l-5,-5l5,-5z"/>
>  </marker>
> </defs>
> <line marker-start="url(#arrow)" style="color:red" stroke-width="5"
>stroke="red" y2="240" x2="293" y1="131" x1="123"/>
></svg>

>Should this give me a red marker?  I could not get any browser to do
>this, maybe it's a support thing?

No, because:
"Properties inherit into the 'marker' element from its ancestors; properties 
do not inherit from the element referencing the 'marker' element."
http://www.w3.org/TR/SVG11/painting.html#MarkerElement

You can write <marker color="red" ...><path fill="currentColor" ...>...
or set color on the svg element.

But this does not really help, if you want to reuse the marker with
different colors. But at least you can reuse the content of marker
with a use-element or a DTD entity definition and put it into 
different marker elements, one for each color.

And ... display="marker" has the same effect as display="inline" or
display="block".

Olaf
Received on Tuesday, 9 February 2010 16:19:01 GMT

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