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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user