fix(html): the underline and the squiggle sit under the text - #914
Merged
Merged
Conversation
Base automatically changed from
fix/a-mark-covers-the-text-it-marks
to
main
September 20, 2026 10:35
`barPath` drew both inside the box: the underline in its bottom sixteenth and the squiggle between an eighth and a quarter above the bottom. Both therefore ran through the descenders they belong under. They now start at `b[3]`, where the glyphs end, and run below it. A strike-out keeps the middle of the box, which is the one that is meant to cross. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149gFxhkvKTBQidz6brU8Vt
andiwand
force-pushed
the
fix/the-underline-sits-under-the-text
branch
from
September 20, 2026 10:36
4cc82e4 to
5f8b520
Compare
`text_markup_appearance` carries its own copy of the geometry, so the view and the appearance stream a save writes have to move together. Both now hang the underline and the squiggle off the bottom edge of the quad. A gtest reads every y the stream names and holds the two under the quad, with the strike-out inside it, which is the rule the browser checks state as well. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149gFxhkvKTBQidz6brU8Vt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported from the app: the two features that mark under text overlap the text instead. Rebased onto
mainnow that #913 has landed, which is what makesb[3]the bottom of the glyph boxes rather than the selection layer's em box.The shapes were drawn inside the box.
underlineb[3] - h/16…b[3]squigglyb[3] - h/8…b[3] - h/4strikeOutb[1] + h/2Both now hang off
b[3]and run below it. The strike-out is untouched.The saved file draws them too.
pdf_annotation.cpp::text_markup_appearancewrites an/APappearance stream and carries its own copy of the same geometry —bar(out, c, c.bottom + height / 16, …)and awavebased atquad.bottom + amplitude. Changing only the view would have left every saved pdf with the underline still through the text, and the two renderers disagreeing. Both move together here.Checked
test/browser/annotation: 70 checks, none failing, three of them new. They read thedthe script writes and compare every y it names against the box, so they state the rule rather than a pixel.odr_test --gtest_filter='PdfAnnotation.*': 9 tests, all passing, one of them new. It parses the appearance stream and holds everym/l/rey under the quad for the underline and the squiggle, and inside it for the strike-out.main's appearance stream the gtest fails with691 vs 688— the squiggle three points up inside the text.🤖 Generated with Claude Code
https://claude.ai/code/session_0149gFxhkvKTBQidz6brU8Vt