Closed knupel closed 1 year ago
When we use textAlign(RIGHT)in P2D or P3D with an odd argument passed to textSize() there is a little offset on right. maybe it's related to https://github.com/processing/processing4/issues/425
textAlign(RIGHT)
P2D
P3D
textSize()
String [] str = new String[26]; int text_size = 6; int interligne = 15; void setup() { // size(400,800); // ok size(400,800, P2D); // problem when text size is odd // size(400,800, P3D); // problem when text size is odd // don(t text with JAVAFX, SVG abd PDF renderer frameRate(1); str[0] = "0"; for(int i = 1 ; i < str.length ; i++) { str[i] = str[i-1] + String.valueOf(int(random(10))); } textAlign(RIGHT); } void draw() { background(0); show_text(); } void show_text() { text_size++; interligne = floor(text_size * 1.4); if(text_size> 20) { text_size = 6; } println(text_size); textSize(text_size); // textAlign(LEFT); // OK textAlign(RIGHT); // KO > problem float x = width/2; for(int i = 0 ; i < str.length ; i++) { text(str[i], x, (i + 1) * interligne); } stroke(255); line(x, 0, x, height); }
I think this is likely the same as #425 so we'll call it a duplicate for now.
When we use
textAlign(RIGHT)
inP2D
orP3D
with an odd argument passed totextSize()
there is a little offset on right. maybe it's related to https://github.com/processing/processing4/issues/425