Skip to content

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 ​

PropertyModifierTypeDescriptionDefined in
axisAlignedreadonlybooleanWhether the mapping is free of rotation and skew, so axis-aligned fast paths stay exact.terminal/src/transform.ts:27
matrixreadonlyMatrixThe composite logical-to-raster matrix.terminal/src/transform.ts:25
uniformreadonlybooleanWhether 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 ​

ParameterTypeDescription
xnumberX coordinate in logical space.
ynumberY coordinate in logical space.

Returns ​

Vertex

The corresponding raster-space vertex.


scalar() ​

scalar(value): number

Defined in: terminal/src/transform.ts:44

Maps a logical length into raster space.

Parameters ​

ParameterTypeDescription
valuenumberThe length in logical units.

Returns ​

number

The length in raster pixels.