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 unnecessary console warnings when using smooth() on P2D Graphics objects #7159

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

zeesworth
Copy link
Contributor

Changes:

Changed smooth implementation to match noSmooth.
Previously smooth would call setAttributes regardless of whether or not the renderer is P2D or WebGL, on Graphics objects (to my knowledge, maybe on others too) when the renderer is P2D, this would cause unnecessary logs complaining about setAttributes's use.
I have changed the smooth function to call setAttributes only if the renderer is WebGL.

I have not tested this extensively (I have though tested this change on one of my own projects using p5.js in which it functions perfectly fine),
but for such a minor change that takes from existing code I feel that it should work fine in all scenarios.
However feel free to close this pull request if there is a specific reason that the smooth function must be programmed this way

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included / updated

Copy link

welcome bot commented Aug 2, 2024

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@davepagurek davepagurek merged commit b99f57f into processing:main Aug 6, 2024
2 checks passed
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.

2 participants