Skip to content

Documentation / @ripl/terminal / letterboxMatrix

Function: letterboxMatrix() ​

letterboxMatrix(scale, offsetX, offsetY): Matrix

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

Builds the letterbox matrix a terminal context maps logical coordinates through: a uniform scale plus the centring offset that fits the logical space into the character grid.

Parameters ​

ParameterTypeDescription
scalenumberThe uniform logical-to-raster scale factor.
offsetXnumberHorizontal centring offset, in raster pixels.
offsetYnumberVertical centring offset, in raster pixels.

Returns ​

Matrix

The letterbox matrix.