-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Added textAscent and textDescent functions on Webgl #7187
Conversation
@davepagurek , Please for a review. I hope you don't mind. |
Thanks for making the changes! Looks like this code will work, which is great. Currently it will recreate the value every time instead of using the same caching flow as 2D mode, so it's probably worth looking into whether we can get the two systems working the same way. If there are any unforeseen issues when we look into that, we can fall back to the technique you're using here. It seems the underlying issue is that 2D mode sets the cached ascent and descent values back to null when font things change, via p5.js/src/core/p5.Renderer2D.js Lines 1307 to 1312 in 0b01116
Meanwhile, the WebGL implementation of this is empty: Lines 8 to 11 in 0b01116
So rather than overriding the ascent and descent functions, we just need to also set them to null in the WebGL implementation of |
Hi @davepagurek , thank you for the help. I have done as instructed. |
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 solving a long lasting issue haha ! Looks good to me.
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.
Looks good, thanks!
Added textAscent and textDescent functions on Webgl
Resolves #4958
Changes:
Screenshots of the change:
Before :
After :
example
PR Checklist
npm run lint
passes