lyon icon indicating copy to clipboard operation
lyon copied to clipboard

MiterClip flips between Miter and Bevel instead of clipping

Open timmb opened this issue 1 year ago • 0 comments

According to the docs, LineJoin should behave the same as in the SVG specification. This means:

  • Miter falls back to Bevel when the miter-limit is exceeded
  • MiterClip crops the miter at the point where miter-limit is exceeded.

However, the behaviour I'm seeing with StrokeTessellator is that both Miter and MiterClip fall back to Bevel when the limit is exceeded.

Example

With

StrokeOptions {
            start_cap: Butt,
            end_cap: Butt,
            line_join: MiterClip,
            line_width: 30.0,
            variable_line_width: None,
            miter_limit: 7.1,
            tolerance: 0.1,
        }

this is the rendered join: image

Increasing the miter limit simple changes the point where it flips to the bevel shown.

Note

This looks the same as https://github.com/nical/lyon/issues/573, however that issue was resolved with a PR, so I'm confused. I'm using lyon = "1.0.1". I also tried specifically using lyon_tessellation = "1.0.15". Perhaps it regressed?

timmb avatar Nov 07 '24 11:11 timmb