p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

fixed textpoint alignment

Open mathewpan2 opened this issue 1 year ago • 2 comments

Resolves #6893

Changes:

Added the _handleAlignment function in p5.Font.js to textToPoints, so that it also follows the renderer's current alignment.

Screenshots of the change:

When textAlign(CENTER, BASELINE); was called, the text points and the normal text would be misaligned.

Before the change: error

After the change: fixed

PR Checklist

  • [x ] npm run lint passes

mathewpan2 avatar Apr 12 '24 22:04 mathewpan2

@mathewpan2 @dhowe @davepagurek Just want to check in, is this ready to merge? We can revisit this as part of 2.0 but want to get fixes in for 1.x where possible and not breaking changes.

limzykenneth avatar Jul 01 '24 14:07 limzykenneth

I think this is ok to merge for now, with a note that this entire class (p5.Font) needs to be rethought for v2.0, where, assuming these function are not moved to a separate module or library, we should support use with and without the renderer in p5, and also, ideally, outside of p5.

dhowe avatar Jul 04 '24 03:07 dhowe

Can we merge this, or is there a plan in place for 2.0?

araid avatar Sep 21 '24 00:09 araid

this can be merged (and there is a plan in place for 2.0)

dhowe avatar Sep 21 '24 02:09 dhowe