Control
Class in @bimworks/viewer2d.
API catalogue · @bimworks/viewer2d · Class
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#
The 2D world coordinates under a canvas position in pixels
Parameters#
| Name | Type | Description |
|---|---|---|
screenCoordinates |
[number, number] |
panMm#
TypeScript#
panMm(x: number, y: number): voidPan 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): voidPan 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): voidZooms 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. |