Skip to content

Documentation / scene / ResolutionTransform

Type Alias: ResolutionTransform

ResolutionTransform = object

Defined in: libs/scene/src/app/screen.ts:53

Resolution transform information derived from a ScreenConfig and a concrete viewport rectangle.

Properties

viewportX

viewportX: number

Defined in: libs/scene/src/app/screen.ts:57

X position of the adjusted viewport in canvas coordinates (CSS pixels).


viewportY

viewportY: number

Defined in: libs/scene/src/app/screen.ts:61

Y position of the adjusted viewport in canvas coordinates (CSS pixels).


viewportWidth

viewportWidth: number

Defined in: libs/scene/src/app/screen.ts:65

Width of the adjusted viewport in canvas coordinates (CSS pixels).


viewportHeight

viewportHeight: number

Defined in: libs/scene/src/app/screen.ts:69

Height of the adjusted viewport in canvas coordinates (CSS pixels).


croppedViewport

croppedViewport: Rect

Defined in: libs/scene/src/app/screen.ts:73

Visible part of the adjusted viewport, i.e. intersection with original viewport.


canvasToViewport

canvasToViewport: PointTransform

Defined in: libs/scene/src/app/screen.ts:79

Transform from canvas coordinates to the adjusted viewport's local coordinates.

Typically used to convert mouse / pointer positions into the active rendering region.


canvasToLogic

canvasToLogic: PointTransform

Defined in: libs/scene/src/app/screen.ts:87

Transform from canvas coordinates to logical coordinates in the design resolution space.

Typically used for UI editing and interaction, so that logic consistently works in designWidth × designHeight space.

Released under the MIT License.