Class Translate

Represents a Translate transformation.

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

  • Creates an instance of Translate.

    Parameters

    • x: number = 0

      The amount to translate along the positive x-axis. Defaults to 0.

    • y: number = 0

      The amount to translate along the positive y-axis. Defaults to 0.

    Returns Translate

Properties

attrs: any
children: Transformation[]
tag: string
x: number
y: number

Methods

  • Adds a Rotate transformation to the current transformation.

    Parameters

    • angle: number = 0

      The amount to rotate clockwise in degrees. Defaults to 0.

    Returns Translate

    The current instance of Transformation for chaining.

  • Adds a Scale transformation to the current transformation.

    Parameters

    • x: number = 1

      The amount to scale in the positive x-axis. Defaults to 1.

    • y: number = 1

      The amount to scale in the positive y-axis. Defaults to 1.

    Returns Translate

    The current instance of Transformation for chaining.

  • Adds a Translate transformation to the current transformation.

    Parameters

    • x: number = 0

      The amount to translate along the positive x-axis. Defaults to 0.

    • y: number = 0

      The amount to translate along the positive y-axis. Defaults to 0.

    Returns Translate

    The current instance of Transformation for chaining.