Vertically centering multiline text

In old processing.js textAlign(CENTER, CENTER) used to vertically center the text on the specified x, y point even when it was multiline (i.e it included "\n"). In p5jsm, it appears to always vertically center align the first line only. The other lines just follow below. It this the intended new functionality? If it is, then thats a lot of extra jiggling we will all need to do in our own code :(

Tagged:

Answers

  • Answer ✓

    So what you're saying is that with the following code you'd expect the text to be vertically aligned around the position of the ellipse:

    textAlign(CENTER, CENTER);
    text("ABCD\nEFGH", 50, 30);
    ellipse(50,30,6,6);
    

    Probably worth raising an issue.

  • Thanks. I raised an issue - lets see how it goes.

  • The issue has been taken up and is now fixed. thanks!

Sign In or Register to comment.