mirror of
https://github.com/penpot/penpot.git
synced 2026-11-06 10:00:38 +00:00
The mark box used the mark's em box (half the base size, square), while painting placed the shaped mark by its tight rect: advance wide, ascent plus descent tall. Text bounds, selection and export therefore disagreed with the canvas; over marks could paint above the bounds. Shape each span's mark once in HorizontalEmphasisMark and place that measured box for paint, text bounds and position data alike. Position data keeps an em box, now centred on the painted mark, because SVG export draws the mark at a font size equal to the box width. Tests that built synthetic placements now pass the mark ink explicitly; their assertions are unchanged. Vertical marks had no mismatch: paint and position data centre on the same point. AI-assisted-by: claude-opus-5-5