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

Fix spikes from wide strokes (#6924) #6928

Merged
merged 3 commits into from Oct 8, 2020
Merged

Conversation

joshuahhh
Copy link
Contributor

@joshuahhh joshuahhh commented Oct 7, 2020

Description of change

This fixes #6924, the spikes-behind-wide-joins problem.

Before: (miter, bevel, round)
before

After: (miter, bevel, round)
after

It's not perfect. In particular, some regions are drawn twice, so strokes with alpha will be a bit mis-drawn. But that was the case before anyway. I believe some documentation already recommends using filters rather than stroke alpha in such cases.

(Note that some edges of the triangulation are incorrectly drawn red in the "round" examples above. This is an unrelated bug, which you can see occurs in both the "before" and "after" cases. If I can isolate it, I will report it as a separate issue.)

Pre-Merge Checklist
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)
Thanks so much!

@JetLua
Copy link
Contributor

JetLua commented Oct 7, 2020

Cool ! This PR also fixed #6903 .

https://pixiplayground.com/#/edit/fxZUnCBQVQhwTi2ePohLv

@bigtimebuddy
Copy link
Member

Thank you for this PR! Great explanation. Will review it. ping @SukantPal

Copy link
Member

@ShukantPal ShukantPal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing these changes! In the future, I think we'll need to do work reducing the technical debt in this file.

@joshuahhh
Copy link
Contributor Author

Thanks for the quick responses!

@bigtimebuddy, I recommend reviewing the change with whitespace ignored – it makes much more sense that way: https://github.com/pixijs/pixi.js/pull/6928/files?diff=unified&w=1.

@SukantPal, I agree that buildNonNativeLine & friends could use a major rework. (For instance, I honestly have no idea why indexCount needs to be tracked the way it is.)

@bigtimebuddy bigtimebuddy linked an issue Oct 7, 2020 that may be closed by this pull request
@codecov-io
Copy link

codecov-io commented Oct 7, 2020

Codecov Report

Merging #6928 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev     #6928   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines          671       671           
=========================================
  Hits           671       671           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f77e09d...af6e3aa. Read the comment docs.

@bigtimebuddy bigtimebuddy added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Oct 8, 2020
@bigtimebuddy bigtimebuddy merged commit 88b488c into pixijs:dev Oct 8, 2020
@bigtimebuddy
Copy link
Member

Another good one @joshuahhh, you're on a roll! Thanks.

bigtimebuddy pushed a commit that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spikes from strokes when a segment contains a neighboring point Near colinear line join
5 participants