Documentation / @ripl/terminal / TerminalTransform
Interface: TerminalTransform ​
Defined in: terminal/src/transform.ts:23
The mapping from the logical space a scene is authored in onto the raster grid, composing the context's letterbox with whatever transform is current.
Every drawing path goes through one of these rather than reading scaleX/scaleY directly: a separable per-axis scale cannot express rotation or skew, which is why transforms used to be discarded by this backend.
Properties ​
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
axisAligned | readonly | boolean | Whether the mapping is free of rotation and skew, so axis-aligned fast paths stay exact. | terminal/src/transform.ts:27 |
matrix | readonly | Matrix | The composite logical-to-raster matrix. | terminal/src/transform.ts:25 |
uniform | readonly | boolean | Whether the mapping scales both axes equally, so a circle stays a circle. | terminal/src/transform.ts:29 |
Methods ​
point() ​
point(
x,y):Vertex
Defined in: terminal/src/transform.ts:37
Maps a point from logical space into raster space.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate in logical space. |
y | number | Y coordinate in logical space. |
Returns ​
The corresponding raster-space vertex.
scalar() ​
scalar(
value):number
Defined in: terminal/src/transform.ts:44
Maps a logical length into raster space.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
value | number | The length in logical units. |
Returns ​
number
The length in raster pixels.