Closed rbstrachan closed 4 months ago
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
It seems that the textWrap()
function (src/typography/attributes.js#L541) does do a simple if then
check to throw
an error, but doesn't use p5._validateParameters()
.
@rbstrachan Issue is as you identified and using p5._validateParameters()
does solve the issue as intended. However, there are some unit test related issue that was left uncaught for awhile and I need to fix that before fixing this. Will try to do so today. Thanks.
Most appropriate sub-area of p5.js?
p5.js version
1.9.2
Web browser and version
Firefox 125.0.2
Operating system
Linux Ubuntu 22.04 LTS
Steps to reproduce this
Steps
textWrap()
insetup()
.Snippet
Notes
When I first tried to use
textWrap()
, I wrongly assumed it took the maximum width, in pixels, of the text before wrapping occurred, so I did something liketextWrap(width * 2 / 3);
. The canvas disappeared and no error was given. I believe I've seen this behavior before with other methods but I can't remember which ones.