Protected_Protected_Protected_Protected_Protected_ReadonlycanvasReadonlycontextProtecteddirtyProtected OptionalimageProtectedmatrixProtectedtotalProtectedtransformProtectedviewportProtected Static ReadonlyNORMAL_Protected Static ReadonlyNORMAL_Protected Static ReadonlySCALE_Protected Static ReadonlySCALE_Protected Static ReadonlySCALE_Protected Static ReadonlySMOOTHING_Protected Static ReadonlyTRANSFORM_ProtectedapplyApplies the current transformation matrix to the canvas context. This method should only be called in the clearContext method.
Centers the current image in the viewport
Clears the canvas context and resets the transformation matrix. This method should be called before drawing new content.
Fits the current image to the view, centering it and scaling it to fit within the viewport.
Moves the view to the specified position.
The new x-coordinate
The new y-coordinate
ProtectednormalizeNormalizes the transformation matrix to prevent floating point errors.
The matrix is reset to the identity matrix and then reapplied.
Resets the view to its default state. This includes resetting the position, scale, and rotation. If an image is present, it will be centered.
Rotates the view by the specified angle in degrees
The angle to rotate by in degrees
Scales the view by a factor from the current center.
The scaling factor (>1 zooms in, <1 zooms out)
Scales the view by a factor from the specified point.
The point to scale from
The new scale factor (between SCALE_MIN and SCALE_MAX)
Sets the size of the canvas element.
The new width of the canvas
The new height of the canvas
Sets the image to be displayed in the view.
Optionalimage: ImageBitmapThe image to display
Sets the rotation of the view to the specified angle in degrees.
The angle to rotate to in degrees
Sets the scale factor of the view.
The new scale factor (between SCALE_MIN and SCALE_MAX)
Sets the total area of the view. This is used to calculate the visible percentage.
The width of the total area
The height of the total area
Updates the transformation matrix based on the current state.
This method should be called after any changes to the view.
The matrix is used to apply transformations to the canvas context.
The order of transformations is scale, rotate, translate.
The rotation is around the center of the canvas.
ProtectedupdateUpdates the viewport area and visible percentage based on the current view.
This method should only be called after applying the transformation matrix.
Manages view transformations for canvas-based image display.
Handles scaling, rotation, translation, and viewport calculations without managing the actual rendering.