region: Screen regions

View source: R/geometry.R

regionR Documentation

Screen regions

Description

A region (rectangle) describes a region of the terminal in cells. Coordinates are 1-based, like R indices and ANSI cursor positions: x is the column and y is the row of the top-left cell.

Usage

region(x = 1L, y = 1L, width = 0L, height = 0L)

Arguments

x, y

Column and row of the top-left cell.

width, height

Size in cells. Negative sizes are clamped to zero.

Details

Rectangles are plain values (lists with class termr_rect), so they can be compared with identical() and are cheap to create during layout.

Value

An object of class termr_rect.

Examples

r <- region(1, 1, 40, 5)
r

termr documentation built on Oct. 21, 2026, 5:13 p.m.