ComPDFKit Web SDK
    Preparing search index...

    Class TransformationBuilder

    Core.Math.TransformationBuilder: records transforms in call order and multiplies them in order in getFinalTransform. Indexes follow insertion order (getAt(0) is the first added and first applied; the internal array is stored reversed).

    Index
    • get length(): number

      Number of recorded matrices.

      Returns number

    • Removes all recorded matrices.

      Returns this

      This builder, for chaining.

    • Returns a recorded matrix.

      Parameters

      • index: number

        Position in insertion order (0 is the first added).

      Returns Matrix

      The matrix at that position.

    • Combines the recorded matrices into one; the first added is applied first.

      Returns Matrix

      The combined transform, or the identity matrix when nothing is recorded.

    • Inserts a matrix.

      Parameters

      • index: number

        Position in insertion order (0 is the first added).

      • matrix: Matrix

        The matrix to insert.

      Returns this

      This builder, for chaining.

    • Removes the most recently added matrix.

      Returns this

      This builder, for chaining.

    • Adds a matrix after all others; it is applied last.

      Parameters

      • matrix: Matrix

        The matrix to add.

      Returns this

      This builder, for chaining.

    • Removes the matrix at this position (counted from the last added, same as getAt).

      Parameters

      • index: number

      Returns this

    • Adds a rotation.

      Parameters

      • angle: number

        Rotation angle; in degrees unless isRadians is true.

      • OptionalisRadians: boolean

        Whether angle is in radians. Defaults to false.

      Returns this

      This builder, for chaining.

    • Adds a scale.

      Parameters

      • Optionalsx: number | null

        Horizontal scale. Defaults to 1.

      • Optionalsy: number | null

        Vertical scale. Defaults to sx.

      Returns this

      This builder, for chaining.

    • Replaces a recorded matrix.

      Parameters

      • index: number

        Position in insertion order (0 is the first added).

      • matrix: Matrix

        The new matrix.

      Returns this

      This builder, for chaining.

    • Adds a skew.

      Parameters

      • kx: number

        Horizontal skew factor.

      • ky: number

        Vertical skew factor.

      Returns this

      This builder, for chaining.

    • Adds a translation.

      Parameters

      • Optionalx: number

        Horizontal offset. Defaults to 0.

      • Optionaly: number

        Vertical offset. Defaults to 0.

      Returns this

      This builder, for chaining.

    • Translates by (x2 − x1, y2 − y1).

      Parameters

      • x1: number
      • y1: number
      • x2: number
      • y2: number

      Returns this

    queue: Matrix[]

    The recorded matrices, most recently added first.