You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent text overlap when multi-column sections span pages (SD-1869) (#2676)
* fix: use actual font size for tab runs instead of hardcoded 12pt default
The tab measurement code hardcoded `maxFontSize: 12` for tab-created lines and tab runs, causing incorrect line height calculations when the surrounding text used a different font size. This also adds `fontSize: '0'` to line styles to eliminate the CSS strut that caused baseline misalignment between normal-flow and absolutely-positioned (tab-aligned) children.
* fix: prevent text overlap when multi-column section spills across pages
When a multi-column section's content spans multiple pages and columns have
unequal heights, the next section's content was positioned at the shorter
column's cursor Y instead of below all column content. This caused visible
text overlap on page 2.
Add maxCursorY to PageState to track the deepest Y reached across all
columns. startMidPageRegion now uses this value so the next section begins
below all column content.
* fix: eliminate CSS strut misalignment between tab-segmented and normal lines
Lines with tab stops use absolute positioning for text segments, which
bypasses the CSS strut. Normal-flow lines inherit the browser's default
16px font-size, creating a strut that shifts text down ~1px via baseline
alignment. This made tab-indented first lines appear shifted up relative
to continuation lines.
Zero the line container's font-size to remove the strut, and restore
explicit font-size on the three child elements that inherit rather than
set their own: empty-run caret placeholder (lineHeight), math run
wrapper (run height), and field annotation wrapper (16px fallback).
* test: add regression test for maxCursorY overlap fix (SD-1869)
Verifies that mid-page column transitions start below the tallest
column when columns have unequal heights. Uses a 3-col → 2-col
transition to exercise the maxCursorY tracking without triggering
the new-page guard (columnIndexBefore >= newColumns.count).
* fix: use browser default font size for math run fallback
run.height is a layout heuristic that can reach 80–100px for tall
expressions (fractions, equation arrays). Using it as the wrapper's
font-size made the plain-text fallback render at that size. Swap to
BROWSER_DEFAULT_FONT_SIZE (16px) — MathML has its own scaling, so the
value only affects the textContent fallback path.
---------
Co-authored-by: Caio Pizzol <caio@harbourshare.com>
0 commit comments