-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Fix unintentionally joined path contours #187522
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,7 +155,7 @@ class StrokePathSegmentReceiver : public PathAndArcSegmentReceiver { | |
| protected: | ||
| // |SegmentReceiver| | ||
| void BeginContour(Point origin, bool will_be_closed) override { | ||
| if (has_prior_contour_ && origin != last_point_) { | ||
| if (has_prior_contour_) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only question I would have is whether we need all 4 of these vertices if the 2 points are the same, but it shouldn't hurt anything I don't think?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if the 2 points are the same, we only need 2 extra vertices instead of all 4. But like you said, I don't think it hurts to have 4. And I like that this keeps the code more consistent and simpler with no extra branching for the same vs different cases. |
||
| // We only append these extra points if we have had a prior contour. | ||
| vtx_builder_.AppendVertex(last_point_); | ||
| vtx_builder_.AppendVertex(last_point_); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do a golden test of this case with all 3 join types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Added a golden test
Before:

After:
