Text rendering with word wrap and RTL often clips
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript
- Área
- frontend
Línea de trabajo
Start by locating the word-wrapping routine that splits text into words and measures each line; the issue identifies trailing spaces and subtracting a space width as the cause. Trim trailing spaces from wrapped lines, then check that RTL text no longer clips while Center and Right alignment remain accurate. The payload does not name a file or test, so first find the relevant implementation and its existing text rendering tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- A bug in the API:
- Phaser version(s): 2.12.0, 2.15.0
- What steps produce the bug: Use RTL text, such as Arabic, with word wrap, so the text wraps.
- What should happen: All letters should render properly.
- What happens instead: One more more letters of the widest line(s) will be truncated on the right.
When the word wrapping routine splits text into words by spaces, each line's string (except possibly the last line) has a trailing space. Each line is then measured, and the width of a space is removed from the line length to account for that trailing space (necessary for accurate Center or Right alignment). For LTR languages, the trailing space for the widest line(s) are actually clipped off by the right side of the context's rectangle because of this. Since spaces are not visible, this is not an issue.
For a RTL language the trailing space is actually drawn on the left. Since text rendering is positioned by the left edge, the subtraction of the width of a space from the width of the line may result in the right side of the text clipped by the width of the space.
Fix: Instead of measuring lines of word wrapped split text with trailing space included, then subtracting the width of a space, simply trim the trailing space of each word wrapped line from the string.
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.4k
- Forks
- 485
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 9
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de phaserjs/phaser-ce
-
Web audio stops playing in iOS 17 and 18 after refocusingQuizá libre de nuevo @samme la tomó hace 633 días y no hay ningún pull request abierto. Abierto
phaserjs/phaser-ce#748 · 2 reacciones · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
phaserjs/phaser-ce#740 · 9 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
phaserjs/phaser-ce#724 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
phaserjs/phaser-ce#711 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de phaserjs/phaser-ce
Issues similares
-
enhancement ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DCGM/semant-demo#708 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Client codegen: an import repeated in an impl file is emitted twice, and the browser rejects the modulePosiblemente ocupada @MalithaPrabhashana la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
jaseci-labs/jac#10756 ·
Los mantenedores suelen responder en 1 día