-
-
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
TextAlign([any], CENTER) does not forcibly wrap text inside of the text block, and the text will spill outside of it #5785
Comments
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! |
I think the issue here is that the vertical alignments are not working consistently when a bounding box is specified (and the behavior does not match the docs). I'm open to opinions, but I think the best fix is to match the docs and exclude lines which are not fully within the specified bounds (this is different than @davepagurek's clip method above) The proposed fix would look like this: |
Thanks @trifoilarity @dhowe @davepagurek. It's fixed in #5787. |
@Qianqianye I'm not sure if we have a unified way of handling warnings, but in the case of text(), the second two parameters are each specified as optional, but it is not clear from the docs that in some cases the 4th is required when the 3rd is included. In the PR linked above, I've added warnings for such cases, but I'm not sure that this is the best approach... For example: textAlign(TOP, TOP);
text('OK', 10, 10, 200); // no height, but works textAlign(TOP, CENTER);
text('Not OK', 10, 10, 200); // fails without height -> warning |
Most appropriate sub-area of p5.js?
p5.js version
1.4.2
Web browser and version
Version 1.43.88 Chromium: 105.0.5195.68 (Official Build) (64-bit)
Operating System
Ubunto 20.04.1
Steps to reproduce this
Steps:
Snippet:
The text was updated successfully, but these errors were encountered: