Bring 2.0 stroke ordering fixes to 1.x #7996
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #6386 for 1.x
We noticed that this sketch https://editor.p5js.org/davepagurek/sketches/yohhELoPC works on Mac but not Windows, where strokes don't render and just appear blank. @Stefterv narrowed it down to a change in 1.10.0 (it works in 1.9.4) and that it also works in 2.0.
I realized that this was fixed in 2.0 in #7369 (we also were adding more visual tests and were noticing that some stroke ones regularly fail on Windows) but that the same changes never made it to 1.11.x. This PR
git cherry-pick
s that PR onto the main branch to get the same changes.There's more context in the comments of that PR, but the main problem is that an earlier change picked a small number that happened to rely on rounding that only happened on Macs, leaving Windows broken by accident. A later change (#7206) made it so that we can just turn that small negative number to 0 and avoid the Windows issues. You'll also see in the diff that the
precision
was bumped tohigh
to fix discrepancies on mobile too (desktop basically always ignores the precision and uses high, but mobile will treat it differently, which in this case would cause similar visual bugs.)https://editor.p5js.org/davepagurek/sketches/yohhELoPC now uses a custom p5 build to test the changes.