Processing 4.3 was just released. We’ve revamped icons to avoid confusion with VSCode, made design & dark mode tweaks, and enhanced text centering. Plus, Java update & critical bug fixes, including syntax error highlighting that was broken in 4.2, and more!
Slightly different is possibly a slight understatement
I’m new to this game; started with Processing 4.2. I’ve always wondered why I had to adjust my vertical alignment of text inside a rectangle.
I haven’t written serious code yet but I basicall need to fix all prototype code now for using Processing 4.3.
Simple example
void setup()
{
size(300, 100);
}
void draw()
{
rectMode(CORNER);
fill(0xFF00FFFF);
int x = 50;
int y = 50;
int w = 200;
int h = 30;
// outer rectangle
stroke(0xFF00FFFF);
rect(x, y, w, h, 10);
// inner rectangle
stroke(0xFF000000);
rect(x + 5, y + 5, w - 10, h - 10, 5);
textSize(20);
textAlign(CENTER, CENTER);
fill(0xFF000000);
text("Hello", x + w / 2, y + h / 2);
}
4.2
4.3
Note
I can live with it, it’s more a warning to others that encounter the same issue.
Yes. The workaround was to just subtract something from the y position till it looked correct. From memory, it however was not a fixed value but depends on the size.
I did not know that it was a bug till I consulted the release notes for 4.3 to check if something had changed with regards to vertical alignment; as I’m new I considered it something that I had to learn to live with. This is a lot better
But I feel sorry for those that have to fix their production code when switching to 4.3