processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.11k stars 3.22k forks source link

fixed textpoint alignment #6967

Open mathewpan2 opened 2 months ago

mathewpan2 commented 2 months ago

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

limzykenneth commented 2 hours ago

@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.