Reference·JavaScript · @bimworks/viewer2dJavaScript

Control

Class in @bimworks/viewer2d.

API catalogue · @bimworks/viewer2d · Class

TypeScript#
class Control

Members#

Member Kind Description
constructor Method
getWorldCoordinatesFromScreenCoordinates Method The 2D world coordinates under a canvas position in pixels
panMm Method Pan in mm
panPixels Method Pan in pixels
zoom Method Zooms the viewer by a multiplicative factor around an optional world-space pivot.

constructor#

TypeScript#
constructor()

getWorldCoordinatesFromScreenCoordinates#

TypeScript#
getWorldCoordinatesFromScreenCoordinates(screenCoordinates: [number, number]): vec2

The 2D world coordinates under a canvas position in pixels

Parameters#

Name Type Description
screenCoordinates [number, number]

panMm#

TypeScript#
panMm(x: number, y: number): void

Pan in mm

Parameters#

Name Type Description
x number The x value (can be negative) in mm
y number The y value (can be negative) in mm

panPixels#

TypeScript#
panPixels(x: number, y: number): void

Pan in pixels

Parameters#

Name Type Description
x number The x value (can be negative) in pixels
y number The y value (can be negative) in pixels

zoom#

TypeScript#
zoom(factor: number, pivot?: number): void

Zooms the viewer by a multiplicative factor around an optional world-space pivot.

Parameters#

Name Type Description
factor number Multiplicative zoom factor.
pivot number Optional world-space pivot.