Renderer resizes and fully repaints every frame at a fractional devicePixelRatio (and leaves seams between cell backgrounds)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2.9k
- Fork
- 174
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/ghostty-web
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
coder/ghostty-web#199 ·
-
attachCustomKeyEventHandler inverts xterm.js's return-value contract (silently swallows all input)Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
coder/ghostty-web#192 ·
-
A single throw inside render() permanently stops the render loop, and a consumer cannot restart itAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
coder/ghostty-web#189 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
coder/ghostty-web#188 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
coder/ghostty-web#187 ·
Tutte le issue di coder/ghostty-web
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
StabilityNexus/Fate-EVM-Frontend#153 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
code-yeongyu/oh-my-openagent#9039 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Tencent/teamai-cli#862 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue hacktoberfest redis
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
libredb/libredb-studio#1164 ·
I maintainer di solito rispondono entro 1 giorno
-
flake
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno