flutter_svg icon indicating copy to clipboard operation
flutter_svg copied to clipboard

svg <marker> not work?

Open jzhgithub18 opened this issue 2 years ago • 3 comments

jzhgithub18 avatar Feb 27 '23 07:02 jzhgithub18

my svg: <svg viewBox="0 0 720 1280" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <marker id="/rc/defs/arrowStyle" zorder="1" markerWidth="5" markerHeight="5" markerUnits="strokeWidth" refX="50" refY="50" viewBox="0 0 100 100" orient="auto"> <path id="/rc/defs/arrowStyle/1" zorder="1" d="M100 50L0 90L30 50L0 10L100 50Z"/> </marker> </defs> <rect xmlns="http://www.w3.org/2000/svg" width="720" height="1280" fill="#FF9900" rx="4" ry="4"/> <line id="/1/1677122352_1@aragorn@令狐冲" zorder="1" stroke="black" stroke-width="3" x1="320" y1="657.60004" x2="431.29999" y2="1063.4" marker-end="url(#/rc/defs/arrowStyle)"/> <path id="/rc/1" zorder="1" d="M100 50L0 90L30 50L0 10L100 50Z"/> <line x1="0" y1="0" x2="250" y2="50" stroke="#000" stroke-width="8" marker-end="url(#/rc/defs/arrowStyle)" /> <text x="60" y="15" style='font-family:sans-serif;font-size: 14pt; stroke:none; fill: black; '>令狐冲</text> </svg> expect: image

present: image

jzhgithub18 avatar Feb 27 '23 08:02 jzhgithub18

It is not implemented in this library. I'm open to it but don't get this request all that often.

dnfield avatar Feb 27 '23 17:02 dnfield

Hi, The library is great, but I also need marker-end implemented. The below fails to draw the arrow head as well.

<svg width="2788" height="1232" viewBox="0 -1232 2788 1232" xmlns="http://www.w3.org/2000/svg"><marker id="arrow" refX="1" refY="5" markerWidth="4" markerHeight="4" viewBox="0 0 10 10" orient="auto" ><path d="M 0 0 L 10 5 L 0 10 z" fill="black" /></marker><line x1="104" y1="-225" x2="164" y2="-225" stroke="black" stroke-width="2" marker-end="url(#arrow)" /></svg>

Thank you.

Zeebzog avatar Oct 05 '23 15:10 Zeebzog