Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context-stroke color does not work #107

Open
jroessel opened this issue Jul 15, 2024 · 0 comments
Open

context-stroke color does not work #107

jroessel opened this issue Jul 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jroessel
Copy link

Describe the bug
context-stroke should be replaced by the stroke value where a marker is rendered. Since we render markers not as markers, but actual geometry we have to replace those special paints accordingly.

To Reproduce

<svg xmlns="http://www.w3.org/2000/svg"
     width="275" height="200" viewBox="0 0 275 200">
  <defs>
    <marker id="Triangle" viewBox="0 0 10 10" refX="1" refY="5" 
            markerUnits="strokeWidth" markerWidth="4" markerHeight="3"
            orient="auto">
      <path d="M 0 0 L 10 5 L 0 10 z" fill="context-stroke"/>
    </marker>
  </defs>

  <g fill="none" stroke-width="10">
    <path stroke="crimson" d="M 100,75 C 125,50 150,50 175,75 l 15 15" marker-end="url(#Triangle)"/>
    <path stroke="olivedrab" d="M 175,125 C 150,150 125,150 100,125" marker-end="url(#Triangle)"/>
  </g>
</svg>

Expected behavior
context-stroke should match the stroke color of the surrounding context. Similarly for context-fill.
Alternatively we could perhaps detect whether those values are used and simply retain the marker as marker instead of rendering it on our own. We'd lose the per-instance different sketching, but at least it still looks correct.

@jroessel jroessel added the bug Something isn't working label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant