# `Atui.Rect`
[🔗](https://github.com/iboard/atui/blob/v0.3.0/lib/atui/rect.ex#L1)

A rectangular region of the terminal, in cell coordinates.

The origin `{0, 0}` is the top-left cell. Rects are used both to describe a
viewport (the whole terminal) and to place a view inside it.

# `t`

```elixir
@type t() :: %Atui.Rect{
  height: non_neg_integer(),
  width: non_neg_integer(),
  x: integer(),
  y: integer()
}
```

# `centered`

Centres a `width` x `height` rect inside `outer`.

The size is clamped to `outer`, so a popup larger than the terminal simply
fills it instead of spilling over the edges.

# `inset`

The rect inset by `n` cells on every side (a border's interior).

# `new`

Builds a rect, clamping the size to zero or more.

# `sized`

A rect at the origin with the given size.

# `to_local`

The same rect moved to the origin — what a view sees when it renders.

---

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