Skip to content

Join fixes - #3

Open
jrmuizel wants to merge 3 commits into
mainfrom
join-fixes
Open

jrmuizel wants to merge 3 commits into
mainfrom
join-fixes

Conversation

@jrmuizel

Copy link
Copy Markdown
Collaborator

This was regressed by 26c0729 (Rasterize curves directly with trapezoids instead of
flattening)

Previously, curve_to_internal emitted the last flattened point with
line_to_capped if the `end` parameter was true. The new curve_to_direct ignored
its end argument and so wasn't capping when it should've.

Instead of ignoring `end` cap if it's set.

From https://bugzilla.mozilla.org/show_bug.cgi?id=2084919
This was regressed by 26c0729 (Rasterize curves directly with trapezoids
instead of flattening)

Previously, curve_to_internal stroked each flattened segment with line_to,
which joined the segments. curve_to_direct instead draws trapezoids that
share normals and doesn't join them. The outer edge of each trapezoid is a
chord of the offset curve, so when a curve turns back on itself over a short
distance the chord falls well inside the offset curve (about 5.5px for a 20px
wide stroke in the bug) and the inner edge can cross itself.

When the normal turns enough that the chord would fall more than half a pixel
inside the offset curve, draw the segment as a rectangle with round joins at
either end instead.

From https://bugzilla.mozilla.org/show_bug.cgi?id=2084919
@jrmuizel

Copy link
Copy Markdown
Collaborator Author

@lsalzman Can you take a look at these fixes?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant