-
-
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
textBounds outputs nan if number is input instead of string #6298
Comments
Thanks @micuat for reporting the bug. I'm tagging this year's GSoC contributor @munusshih who's working on typography related issues, and the mentors @kyeah @aahdee @limzykenneth. |
The initial PR that I made had some issues, so I closed it and made a new one. You can delete the previous one. |
@adityagarg06 I would suggest discussing potential fixes here first before making any implementation as the approach filed in a PR may not be the one we preferred. |
@limzykenneth Thank you for your response will surely take care of that. |
@micuat Raised a good point in the PR that string coersion for basic types like numbers will work fine but how are we to handle object types? And as @kyeah also identified the same above, my opinion is also the same that when it comes to type coersion for |
what is the consensus here? do we want to support non-string types in text() for v2.0 ? or just primitives (string, number, boolean) ? one easy option is to simply call |
I believe in some parts of the library where string or number is expected there is an attempt to try to convert the type such as with |
Most appropriate sub-area of p5.js?
p5.js version
1.7.0
Web browser and version
FF 115.0.2
Operating System
mac 12.6
Steps to reproduce this
Steps:
Snippet:
https://editor.p5js.org/micuat/sketches/sYWYkUTJv
console:
I'm not sure what is the expected result (number + "" would solve the issue). If number is not accepted, there should be an error message, I suppose?
The text was updated successfully, but these errors were encountered: