Fix cursor/background vertical alignment in SVG screenshots

- Remove dominant-baseline: text-before-edge (has Safari compatibility issues)
- Use separate y positions for rect (top of cell) and text (baseline)
- rect_y = padding + row * line_height (top of cell)
- text_y = rect_y + font_size (alphabetic baseline position)

This ensures background rects and text are properly aligned across all
browsers, fixing the half-line vertical offset on cursor blocks.
This commit is contained in:
GitHub Copilot
2026-01-24 19:55:45 +00:00
parent 1d09ff151f
commit 1f5e5c2c31
5 changed files with 11 additions and 8 deletions
-2
View File
@@ -152,8 +152,6 @@ class TestRenderTerminalSvg:
def test_css_properties(self) -> None:
"""SVG includes essential CSS properties for proper rendering."""
svg = render_terminal_svg([], width=80, height=24)
# Check for proper baseline alignment
assert "dominant-baseline: text-before-edge" in svg
# Check for legibility optimization
assert "text-rendering: optimizeLegibility" in svg
# Check for monospace font