You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure the best way to fix this; if you're drawing text onto a different renderer like a graphic, there's not a deterministic way to figure out which renderer to use ahead of time. The best option might be to let you pass that value in, which might require a change to the arguments to this function to not have an overwhelmingly long parameter list.
The text was updated successfully, but these errors were encountered:
Thanks @davepagurek -- this is a known-issue discussed in #6967
The fix, which will hopefully be included in v2.0, is to accept textLeading (and all other relevant params) as part of options
Most appropriate sub-area of p5.js?
p5.js version
1.9.4
Web browser and version
Firefox, Chrome
Operating system
MacOS
Steps to reproduce this
Steps:
textBounds()
of multiline text, passing in a larger font size than the default (e.g. 50)Snippet:
In this example, I'm setting the font size on a graphic, so the main canvas still has the default text size:
Result:
Expected:
Cause
In the implementation of
textBounds
, it gets the text leading from the main instance's renderer:p5.js/src/typography/p5.Font.js
Line 209 in 6781c1d
I'm not sure the best way to fix this; if you're drawing text onto a different renderer like a graphic, there's not a deterministic way to figure out which renderer to use ahead of time. The best option might be to let you pass that value in, which might require a change to the arguments to this function to not have an overwhelmingly long parameter list.
The text was updated successfully, but these errors were encountered: