Skip to content

Function: rectScreenGeometry() ​

ts
function rectScreenGeometry(sx0, sy0, sx1, sy1, style): RectScreenGeometry;

Experimental

CPU mirror of the vertex shader for an axis-aligned (2D) projection: given the projected corners (sx0, sy0) and (sx1, sy1) in CSS px, apply border rounding and pixel snapping.

Parameters ​

ParameterType
sx0number
sy0number
sx1number
sy1number
style{ borderAlign: RectBorderAlign; borderWidth: number; pixelRatio: number; snap: boolean; }
style.borderAlignRectBorderAlign
style.borderWidthnumber
style.pixelRationumber
style.snapboolean

Returns ​

RectScreenGeometry

Released under the MIT License.