text_selection library

Classes

SelectionAppearance
Values chosen by a selection context from its shared style resource. Every target receives this appearance, including across nested instances.
TextSelectionController
Coordinates one read-only range across editor and native Text instances. The host supplies targets in reading order and arbitrates pointer-down against its other interactive objects. Once captured, moves may cross gaps.
TextSelectionGlyph
One displayed glyph cluster, captured from the regular Text render layout.
TextSelectionHit
A character endpoint and its squared distance from the pointer, measured in root artboard coordinates. Offsets throughout this API are Unicode code points, never UTF-16 code units.
TextSelectionTarget
A regular Text instance participating in a shared selection. Implementations use the same layout and clipping as their renderer. Instance identity must remain stable across frames, including repeated nested artboards.

Functions

hitTextSelectionGlyphs(Iterable<TextSelectionGlyph> glyphs, Mat2D transform, Vec2D point, {bool nearest = false}) → TextSelectionHit?
Maps the existing displayed glyphs to endpoints without reshaping text.