mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
fix(terminal): keep subpixel text on the retained replay frame (#39981)
Since the xterm 6.1.0-beta.336 rows stopped clipping with overflow:hidden, Chromium draws the transparent replay copy over the opacity-0 screen with grayscale antialiasing while the live screen keeps LCD text, so glyphs shimmered for the replay hold on subpixel-AA systems. Paint the copy with the terminal's opaque background so it keeps LCD text. Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -38,6 +38,12 @@ export function retainTerminalReplayFrame(
|
||||
overflow: 'hidden',
|
||||
pointerEvents: 'none'
|
||||
})
|
||||
// Why: Chromium drops subpixel (LCD) text for a transparent copy over the hidden screen.
|
||||
const background =
|
||||
screen.parentElement && getComputedStyle(screen.parentElement).backgroundColor
|
||||
if (background?.startsWith('rgb(')) {
|
||||
frame.style.backgroundColor = background
|
||||
}
|
||||
for (const child of screen.children) {
|
||||
if (!child.matches('.xterm-helpers')) {
|
||||
frame.append(child.cloneNode(true))
|
||||
|
||||
Reference in New Issue
Block a user