p5.js
p5.js copied to clipboard
fixed textpoint alignment
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:
After the change:
PR Checklist
- [x ]
npm run lintpasses
@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.
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.
Can we merge this, or is there a plan in place for 2.0?
this can be merged (and there is a plan in place for 2.0)