Terminality’s layout engine is built on five plain structs —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Rikitav/Terminality/llms.txt
Use this file to discover all available pages before exploring further.
Point, Vector, Size, Thickness, and Rect — that live in the terminality namespace and are imported via terminality:Geometry. They carry no heap allocations and are passed by value throughout the framework. Understanding them is a prerequisite for implementing MeasureOverride, ArrangeOverride, and any rendering code that works with coordinates.
Point
A 2-D integer coordinate. Used for cursor positions, child origins, and hit-test queries.Fields
| Field | Type | Description |
|---|---|---|
X | int32_t | Column coordinate (0 = left edge). |
Y | int32_t | Row coordinate (0 = top edge). |
Constructors
0, so Point{} is equivalent to Point::Zero.
Static constants
| Constant | Value |
|---|---|
Point::Zero | Point(0, 0) |
Operators
Vector
A directed segment between twoPoint values. Used internally to describe diagonal extents and is accepted by Size(Vector).
Fields
| Field | Type | Description |
|---|---|---|
From | Point | Start of the vector. |
To | Point | End of the vector. |
Constructors
Operators
Size
Width/height dimensions returned fromMeasureOverride and stored in layout constraints.
Fields
| Field | Type | Description |
|---|---|---|
Width | int32_t | Horizontal extent in columns. |
Height | int32_t | Vertical extent in rows. |
Constructors
Static constants
| Constant | Description |
|---|---|
Size::Zero | Size(0, 0) — empty size. |
Size::Auto | Sentinel value meaning “measure to content”. The framework treats Width == -1 && Height == -1 as auto. |
Operators
Thickness
Four independent insets (left, top, right, bottom) used forMargin, Padding, and border widths.
Fields
| Field | Type | Description |
|---|---|---|
Left | int32_t | Inset on the left edge. |
Top | int32_t | Inset on the top edge. |
Right | int32_t | Inset on the right edge. |
Bottom | int32_t | Inset on the bottom edge. |
Constructors
Static constants
| Constant | Description |
|---|---|
Thickness::Zero | All sides 0. |
Thickness::Single | All sides 1. Useful for a one-cell border. |
Methods
Horizontal() and Vertical() are the values you subtract from an available Size when computing inner content bounds:
Operators
Rect
An axis-aligned rectangle described by an origin(X, Y) and dimensions (Width, Height). Used in ArrangeOverride as finalRect and in render clipping.
Fields
| Field | Type | Description |
|---|---|---|
X | int32_t | Left edge column. |
Y | int32_t | Top edge row. |
Width | int32_t | Horizontal span in columns. |
Height | int32_t | Vertical span in rows. |
Constructor
Instance methods
Right() — exclusive right edge
Right() — exclusive right edge
X + Width. One column past the last occupied column.Bottom() — exclusive bottom edge
Bottom() — exclusive bottom edge
Y + Height. One row past the last occupied row.AsSize() — extract dimensions
AsSize() — extract dimensions
Size(Width, Height), discarding the origin. Useful when you need to pass dimensions to MeasureOverride.IsEmpty() — zero-area test
IsEmpty() — zero-area test
true when Width <= 0 || Height <= 0.Contains(Point) — point hit-test
Contains(Point) — point hit-test
true when point falls within the rectangle (inclusive on all edges, exclusive at Right() and Bottom()).Contains(Rect) — containment test
Contains(Rect) — containment test
true when inner is fully enclosed by this rectangle.Intersects(Rect) — overlap test
Intersects(Rect) — overlap test
true when the two rectangles share at least one cell.Static methods
Rect::Union(a, b) — bounding rectangle
Rect::Union(a, b) — bounding rectangle
Rect that contains both a and b.Rect::Enclose(into, rect) — constrain origin
Rect::Enclose(into, rect) — constrain origin
rect so that it fits inside into without resizing it. If rect is already contained, it is returned unchanged.Rect::Clip(into, rect) — intersection
Rect::Clip(into, rect) — intersection
into and rect. If the two rectangles do not overlap, returns an empty Rect.