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

Direction of markers and line caps on segment boundaries #79

Closed
nikosandronikos opened this issue Apr 6, 2016 · 2 comments
Closed

Direction of markers and line caps on segment boundaries #79

nikosandronikos opened this issue Apr 6, 2016 · 2 comments

Comments

@nikosandronikos
Copy link
Member

Currently, the SVG 2 draft says that the direction of a path at a segment boundary is based on the direction of the segment originating at that point. This is because the directionality algorithm is endpoint exclusive.

The relevant text is:

The direction of a path at a specified distance along the path is defined as follows:
If the given distance is zero, <snip>
Otherwise, if the given distance is the length of the path, <snip>
Otherwise, if the given distance along the path occurs at a path segment boundary, then the direction of the path is the direction at the start of the segment at the given distance, considering each segment to be endpoint exclusive.
Otherwise, the given distance along the path occurs in the middle of a non-zero length path segment. <snip>
Source: https://svgwg.org/svg2-draft/paths.html#PathDirectionality

If I'm reading this correctly, this means that for caps (e.g. a round cap), an end cap may not be oriented correctly against a dash if the dash ends exactly on the boundary point.

What I think we want to do here, is to say:

  • for a start cap, direction should be based on the segment originating from the path segment boundary
  • for an end cap, direction should be based on the segment ending at the path segment boundary

Here's an example that shows current behaviour:
https://jsfiddle.net/dodgeyhack/ob3dr3p9/

This might apply to markers too, though markers may have some special text relevant to start and end markers.

@nikosandronikos
Copy link
Member Author

@nikosandronikos
Copy link
Member Author

Addressed in 996076a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant