Visual selection overlay in display coordinates.
Sent as coordinate ranges so the GUI can render selection as Metal quads behind text, avoiding line re-rasterization when the selection changes.
Summary
Functions
Builds a selection from the render context's visual_selection.
Builds a selection clipped to the visible viewport.
Types
@type selection_type() :: :char | :line | :block
@type t() :: %Minga.RenderModel.Window.Selection{ end_col: non_neg_integer(), end_row: non_neg_integer(), start_col: non_neg_integer(), start_row: non_neg_integer(), type: selection_type() }
@type visual_selection() :: nil | {:char, {non_neg_integer(), non_neg_integer()}, {non_neg_integer(), non_neg_integer()}} | {:line, non_neg_integer(), non_neg_integer()}
Functions
@spec from_visual_selection(visual_selection(), non_neg_integer()) :: t() | nil
Builds a selection from the render context's visual_selection.
@spec from_visual_selection( visual_selection(), non_neg_integer(), pos_integer(), non_neg_integer(), pos_integer() ) :: t() | nil
Builds a selection clipped to the visible viewport.