@arcmantle/library
    Preparing search index...

    Manages view transformations for canvas-based image display.
    Handles scaling, rotation, translation, and viewport calculations without managing the actual rendering.

    Index

    Constructors

    Properties

    _position: Vec2 = ...
    _rotation: number = 0
    _scaleFactor: number = 1
    _viewport: Viewport = ...
    _visiblePercentage: number = 0
    canvas: OffscreenCanvas
    context: OffscreenCanvasRenderingContext2D
    dirty: boolean = true
    image?: ImageBitmap
    matrix: DOMMatrix = ...
    totalArea: number = 0
    transformCount: number = 0
    viewportArea: number = 0
    NORMAL_SCALE_LOWER_BOUND: 0.9
    NORMAL_SCALE_UPPER_BOUND: 1.1
    SCALE_MAX: 7
    SCALE_MIN: 0.1
    SCALE_NORMALIZATION_TOLERANCE: 0.1
    SMOOTHING_SCALE_THRESHOLD: 1 = 1.0
    TRANSFORM_THRESHOLD: 50

    Accessors

    Methods

    • Sets the size of the canvas element.

      Parameters

      • width: number

        The new width of the canvas

      • height: number

        The new height of the canvas

      Returns void

    • Sets the total area of the view. This is used to calculate the visible percentage.

      Parameters

      • width: number

        The width of the total area

      • height: number

        The height of the total area

      Returns void

    • 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.

      Returns void