Skip to content

Place underline, strike and link rectangles from the baseline-adjusted line top - #1830

Merged
blikblum merged 1 commit into
foliojs:masterfrom
ChangkeunJ:fix/decorations-follow-baseline
Oct 26, 2026
Merged

blikblum merged 1 commit into
foliojs:masterfrom
ChangkeunJ:fix/decorations-follow-baseline

Conversation

@ChangkeunJ

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix. Fixes #994 and #1245.

With baseline set to anything other than the default, the glyphs are drawn an ascent higher than the top of the line box, but the underline, the strike-through and the link and goTo rectangles were still measured from the top of the line, so they ended up an ascent too low (the underline sits well below the text with alphabetic, as in the screenshots on #994). This moves all four onto the same baseline-adjusted line top that _fragment already derives dy from, so the default baseline is unchanged and the others line up.

The new test fails on master (underline y 60.1 with alphabetic where 51.484 is right at 12pt Helvetica, one ascent off) and passes with the change. The rest of the unit and visual suites pass too.

Checklist:

  • Unit Tests
  • Documentation N/A (no API change)
  • Update CHANGELOG.md
  • Ready to be merged

…d line top

With a baseline other than the default the glyphs move up by the ascent, but
the decorations and the link and goTo rectangles were still measured from the
top of the line box, so they sat an ascent too low. Fixes foliojs#994, foliojs#1245
@blikblum
blikblum merged commit d63a78e into foliojs:master Oct 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Underline y-position wrong for baseline "alphabetic"

2 participants