Skip to content

nimterm/geometry

This page is generated from the module’s exported API and ## documentation comments.

Terminal-cell geometry and sizing constraints.

Size = object
w*: int
h*: int

View source

Rect = object
x*: int
y*: int
w*: int
h*: int

View source

Constraints = object
minSize*: Size
maxSize*: Size

View source

proc size(w, h: int): Size {.raises: [], tags: [], forbids: [].}

Returns: Size.

Name Type Default
w int
h int

View source

proc rect(x, y, w, h: int): Rect {.raises: [], tags: [], forbids: [].}

Returns: Rect.

Name Type Default
x int
y int
w int
h int

View source

proc unconstrained(): Constraints {.raises: [], tags: [], forbids: [].}

Returns: Constraints.

View source

proc clamp(constraints: Constraints; wanted: Size): Size {.raises: [], tags: [],
forbids: [].}

Returns: Size.

Name Type Default
constraints Constraints
wanted Size

View source

proc contains(area: Rect; x, y: int): bool {.raises: [], tags: [], forbids: [].}

Returns: bool.

Name Type Default
area Rect
x int
y int

View source