Commit Graph
2 Commits
Author SHA1 Message Date
O Hingst 9ca2927807 docs: credit MatrixMagician in the About window by their GitHub profile name 2026-10-20 18:55:34 +01:00
O Hingst f99966a195 fix(render): hit-test selection against the glyph quad, not its bounding box (#3693)
PageText::nearest measured the distance to each glyph's axis-aligned bounding
box. In sheared or turned text that box is wider than the glyph and overlaps its
neighbours, so a pointer on a letter was also inside the box of the letter before
it, at distance 0, and the earlier glyph won. A drag ending on the last letter of
a word or line then ended one or two letters short.

A glyph whose drawn em box (quad) holds the point now wins, the nearest centre if
several do. With no quad hit the bounding-box distance still decides, so pointers
past a line end or between lines behave as before; a tie there goes to the nearer
centre rather than the first glyph.

Tests: pdfcraft-render lib 312 -> 314. The sheared and 45-degree test fails on
the old hit-test (glyph "i" resolves to the glyph before it) and passes now.
pdfcraft-ui-egui text_select: 14 pass.
2026-10-20 18:52:38 +01:00