new Viewport()
Used to indicate how the user views the content inside of the canvas.
- Source:
Members
inverseMatrix
Inverse of the local transformation matrix.
- Source:
matrix
Local transformation matrix applied to the object.
- Source:
matrixNeedsUpdate
If true the matrix is updated before rendering the object.
- Source:
moveOnScale
Flag to indicate if the viewport should move when scalling.
For some application its easier to focus the target if the viewport moves to the pointer location while scalling.
- Source:
position
Position of the object.
- Source:
rotation
Rotation of the object relative to its center.
- Source:
rotationPoint
Value of the initial point of rotation if the viewport is being rotated.
Is set to null when the viewport is not being rotated.
- Source:
scale
Scale of the object.
- Source:
uuid
UUID of the object.
- Source:
Methods
centerObject(object, canvas)
Center the viewport relative to a object.
The position of the object is used a central point, this method does not consider "box" attributes or other strucures in the object.
Parameters:
Name | Type | Description |
---|---|---|
object |
Object2D | Object to be centered on the viewport. |
canvas |
DOM | Canvas element where the image is drawn. |
- Source:
updateMatrix()
Calculate and update the viewport transformation matrix.
Also updates the inverse matrix of the viewport.
- Source: