Renderer resizes and fully repaints every frame at a fractional devicePixelRatio (and leaves seams between cell backgrounds)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Start in the CanvasRenderer.render() and resize() paths mentioned in the report, then reproduce the issue at a fractional devicePixelRatio such as 1.36. Verify the canvas dimensions are compared using the same integer sizing that resize() applies, and check that idle frames no longer resize or fully repaint and that coloured cell backgrounds have no visible seams.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version: ghostty-web 0.4.0-next.20.g1858a59 (also current main, 1858a59)
What happens
With a non-integer window.devicePixelRatio (browser zoom other than 100%, a scaled display, e.g.
1.36 or 2.2), the canvas renderer calls resize() and does a full redraw on every animation
frame, about 60 times a second while nothing changes. The caret and output look "busy", and CPU
use goes up. Cell backgrounds are also drawn at fractional device-pixel edges, which leaves
hairline seams (a visible grid) over coloured backgrounds.
Cause
CanvasRenderer.render() checks
this.canvas.width !== D.cols * this.metrics.width * this.devicePixelRatio
canvas.width is always an integer and the right-hand side is fractional at a fractional DPR, so
the check is true on every frame and resize() runs again, forcing a full redraw.
Repro
Open the demo, set browser zoom to 110% (or run Chrome with --force-device-scale-factor=1.36),
then wrap term.renderer.resize to count calls: about 60/s while idle. At DPR 1 or 2: 0/s.
Fix suggestion
Compare against Math.round(cols * width * dpr) (as resize() sets it), or render at
Math.ceil(devicePixelRatio) and let the browser scale the canvas down. The second also removes
the seams. We work around it by setting renderer.devicePixelRatio = Math.ceil(window.devicePixelRatio)
after open(), re-applied on a resolution media-query change. That took idle resizes from 60/s
to 0 and removed the seams.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.9k
- Forks
- 174
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 coder/ghostty-web
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
coder/ghostty-web#199 ·
-
attachCustomKeyEventHandler inverts xterm.js's return-value contract (silently swallows all input)Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
coder/ghostty-web#192 ·
-
A single throw inside render() permanently stops the render loop, and a consumer cannot restart itAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 65/100
coder/ghostty-web#189 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
coder/ghostty-web#188 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
coder/ghostty-web#187 ·
Todos los issues de coder/ghostty-web
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rohitg00/agentmemory#1428 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
boxlite-ai/boxlite#1729 ·
Los mantenedores suelen responder en 1 día
-
Detect Deno tasks from deno.jsonAbiertodetectors enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
SM260845/readme-gen#1 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
angular/angularfire#3774 ·
Los mantenedores suelen responder en 2 días