# `Minga.RenderModel.Window.Selection`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/render_model/window/selection.ex#L1)

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.

# `selection_type`

```elixir
@type selection_type() :: :char | :line | :block
```

# `t`

```elixir
@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()
}
```

# `visual_selection`

```elixir
@type visual_selection() ::
  nil
  | {:char, {non_neg_integer(), non_neg_integer()},
     {non_neg_integer(), non_neg_integer()}}
  | {:line, non_neg_integer(), non_neg_integer()}
```

# `from_visual_selection`

```elixir
@spec from_visual_selection(visual_selection(), non_neg_integer()) :: t() | nil
```

Builds a selection from the render context's visual_selection.

# `from_visual_selection`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
