Type Object Selection by Path Only: every baseline, Type tool and Eyedropper (review of #475)

- Type is picked on the baseline of any of its lines (point type and area
  type, besides area type's frame), as in Illustrator, not only the first
  one: the layout's baselines are cached with its bounds
  (`TextObject::cached_baselines`, from `TextLayout::baselines`), with the
  first one across the bounds as the fallback. Vertical type's runs down
  each column's centre line.
- Type in perspective is picked where it is drawn (through its projection).
- The bounds rule type out before its path is built, so hovering stays
  free of allocations away from type.
- The Type tools still edit type clicked among its characters (they made
  new type there with the preference on), and the Eyedropper still samples
  it there, as it does inside fills with Object Selection by Path Only.
- Tests for all of it; docs/mcp.md and ROADMAP say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-08 18:59:47 +07:00
co-authored by Claude Opus 5.5
parent beea693ee1
commit afb438367d
15 changed files with 208 additions and 32 deletions
+4 -3
View File
@@ -1212,9 +1212,10 @@ Not read yet: Construction Guides and their Angles, and Spacing Guides (the tool
- `missingGlyphProtection` (on by default): `text.setStyle` and `text.setRangeStyle` changing the font leave the
characters the new font has no glyph for in the font that had one.
- `typeSelectionByPathOnly` (off by default): on, the Selection tools (`pointer_gesture` with `selection`, and the
mouse) pick type on its type path only — point type's baseline, area type's frame, type on a path's path — within
`selectionTolerance`; a click among the glyphs or inside the frame selects nothing. Off, anywhere in the type's
bounds selects it.
mouse) pick type on its type path only — the baseline of each of its lines (a vertical column's centre line), area
type's frame, type on a path's path — within `selectionTolerance`; a click among the glyphs, between the lines or
inside the frame selects nothing. Off, anywhere in the type's bounds selects it. Marquee selection is unchanged, and
the Type tools (a click among the characters edits them) and the Eyedropper (`eyedropper`) are not affected.
```json
{"name":"run_command","arguments":{"command":"prefs.set","params":{"values":{"typeSizeIncrement":4,"trackingIncrement":50}}}}