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*: intRect = object x*: int y*: int w*: int h*: intConstraints
Section titled “Constraints”Constraints = object minSize*: Size maxSize*: SizeProcedures
Section titled “Procedures”proc size(w, h: int): Size {.raises: [], tags: [], forbids: [].}Returns: Size.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
w |
int |
|
h |
int |
proc rect(x, y, w, h: int): Rect {.raises: [], tags: [], forbids: [].}Returns: Rect.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
x |
int |
|
y |
int |
|
w |
int |
|
h |
int |
unconstrained
Section titled “unconstrained”proc unconstrained(): Constraints {.raises: [], tags: [], forbids: [].}Returns: Constraints.
proc clamp(constraints: Constraints; wanted: Size): Size {.raises: [], tags: [], forbids: [].}Returns: Size.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
constraints |
Constraints |
|
wanted |
Size |
contains
Section titled “contains”proc contains(area: Rect; x, y: int): bool {.raises: [], tags: [], forbids: [].}Returns: bool.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
area |
Rect |
|
x |
int |
|
y |
int |