-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fixed line drawing in WebGL when there is a previously defined texture #5982
Conversation
🎉 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! |
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.
Thanks for making this change happen! I tested locally, looks good!
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.
Oh, the tests caught something I didn't test: drawing an image using image()
now adds lines. Demo here, try toggling which p5 import in index.html is commented to see how p5 1.5.0 behaves: https://editor.p5js.org/davepagurek/sketches/nbzbYeVbp
I think we probably just need to call noStroke()
in the WebGL implementation of image()
: https://github.com/processing/p5.js/blob/main/src/webgl/3d_primitives.js#L1998
src/webgl/3d_primitives.js
Outdated
@@ -1995,6 +1995,7 @@ p5.RendererGL.prototype.image = function( | |||
|
|||
this._pInst.noLights(); | |||
|
|||
noStroke(); |
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.
Right now the tests are still failing, I believe it's because we can't call the global noStroke()
here in case p5 is running in instance mode. I think calling this._pInst.noStroke()
should fix it though!
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.
Awesome, thanks for making those changes!
Resolves #5440
Changes:
Removed
&& this.drawMode !== constants.TEXTURE
fromcalculateStroke
.Screenshots of the change:
Using the example from #5440,
PR Checklist
npm run lint
passes