pub struct AccessRun {
pub key: Key,
pub line: usize,
pub start: usize,
pub end: usize,
pub text: String,
pub rect: Rect,
pub char_lengths: Vec<u8>,
pub char_positions: Vec<f32>,
pub char_widths: Vec<f32>,
pub word_starts: Vec<u8>,
pub rtl: bool,
}Expand description
One visual line (or a piece of one) of an editor’s text, with what a
screen reader needs to read it by character and word and to place a
caret: every character’s byte length, x position and width. A line
that continues into another ends with its "\n", counted as a
character of zero width. Runs longer than RUN_CHARS characters are
split, so indices fit the platform’s byte-sized ones.
Fields§
§key: KeyThe run’s own id (derived from the editor’s key).
line: usizeThe line it belongs to: a buffer line for a built-in editor, the
ordinal of the role="line" node for a custom one.
start: usizeByte range of the run inside the line’s text (the "\n" excluded).
end: usize§text: String§rect: RectLogical px, viewport coordinates, cut to the clip the text is
drawn under as a node’s rect is; char_positions still place
every character where it is drawn.
char_lengths: Vec<u8>§char_positions: Vec<f32>Each character’s x relative to rect.x, and its width.
char_widths: Vec<f32>§word_starts: Vec<u8>Character indices where words start.
rtl: bool