-
-
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
Allow textAlign(CENTER, CENTER)
with max width but no max height
#5933
Comments
I would like to work on this issue |
Sounds good @Prateek462003 . Please go ahead and submit a pull request. Let us know if you have any questions. Thank you. |
@Qianqianye have the recent fixes to text-handling been made live ? |
@dhowe I think this issue's fix #5880 isn't released just yet -- @dfg2-teacher I think your issue will be fixed by that in the next p5 release 🙂 |
Hi @davepagurek,
|
Thanks @sawaisinghh! Would you be interested in making a PR with the change and some screenshots of how it looks using the new code? |
This might related to the issue #6056 |
@davepagurek I made a PR, please review it. |
@Qianqianye yes, that issue were related to this. and I solved it in this pull request #6060 |
See my review in the PR here |
Most appropriate sub-area of p5.js?
p5.js version
1.5.0
Web browser and version
Firefox 108.0
Operating System
MacOS 12.5.1
Steps to reproduce this
In older versions of p5 (e.g. 1.4.2), one could use
textAlign(CENTER, CENTER)
and then calltext('something', x, y, w)
without specifying a height parameter after. This used to center the text vertically about the y coordinate specified, without clipping any of the lines of text.In 1.5.0 onwards, this results in a warning and no text displaying:
Live: https://editor.p5js.org/davepagurek/sketches/2a9gQGPCX (uncomment the v1.4.2 script tag in index.html and comment out the 1.5.0 one to see the prior behaviour.)
Some p5 examples use this older form (e.g. https://p5js.org/reference/#/p5.SoundRecorder, the "Done! Tap to play and download" text) and no longer correctly display text. We can update these examples, but it might also be more futureproof to handle the no-clipping case along with the clipping case (which was broken in 1.4.2, fixed in #5787.)
The text was updated successfully, but these errors were encountered: