processing / processing/processing4
Text mis-aligned when scaling and using `textSize()` with `P2D`
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 494
- Forks
- 183
- Merge moyen
- 4 h 39 min
- PR mergées (30 j)
- 3
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par exécuter le sketch Processing fourni avec le renderer P2D, puis comparez-le au renderer par défaut tout en effectuant une mise à l’échelle et en appliquant la textSize() inverse. Étudiez le comportement de l’alignement du texte et de l’espacement des caractères du renderer ; le travail est terminé lorsque le texte reste visuellement immobile et que son espacement reste uniforme lorsque l’échelle change.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- computer-graphics
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100