processing / processing/processing4
Text mis-aligned when scaling and using `textSize()` with `P2D`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 497
- Forks
- 183
- Ø Merge
- 4 Std. 39 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
Created by: Santarii
Expected Behavior
If I use the scale function and then use the textSize function to reverse that scaling, I expect to get the same result as just rendering the text without any scaling.
Current Behavior
In the default renderer the text is lower than it should be when scaled up then sized back down. In P2D the space between characters also changes.
Steps to Reproduce
float scale = 1;
void setup() {
size(1920, 1080, P2D);
textFont(createFont("Consolas", 256));
}
void draw() {
scale += 1;
scale(scale);
background(0);
textAlign(LEFT, TOP);
textSize(256f/scale);
text("Wow", 0, 0);
}
This code renders text, and each frame increases the scale, but the scale is exactly reversed with the textSize function. If the bug didn't exist, this would look like stationary unchanging text, however this is not the case.
Your Environment
- Processing version: 4.0b6
- Operating System and OS version: Windows 10 Home 64-bit. 10.0.19043 Build 19043.
Possible Causes / Solutions
It seems to not just be small values in textSize, even reasonable values mess with the alignment a bit, though very small values have a more significant effect.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Führe zunächst die bereitgestellte Processing-Skizze mit dem P2D-Renderer aus und vergleiche sie dann mit dem Standard-Renderer, während du skalierst und die inverse textSize() anwendest. Untersuche das Textausrichtungs- und Zeichenabstandsverhalten des Renderers; abgeschlossen ist die Aufgabe, wenn der Text beim Ändern der Skalierung visuell stationär bleibt und gleichmäßig beabstandet ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- computer-graphics
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100