Class AspectRatioHandler

An AspectRatioHandler provides the proper width and height of a canvas given an AspectRatio and resolution.

Constructors

Accessors

  • get height(): number
  • The calculated canvas height.

    Returns number

  • get width(): number
  • The calculated canvas width.

    Returns number

Methods

  • Creates an AspectRatio object with the given width ratio, height ratio, and name.

    Parameters

    • widthRatio: number

      If this value is less than 1, this method will return undefined.

    • heightRatio: number

      If this value is less than 1, this method will return undefined.

    • Optionalname: string

      If this value is not specified, the name of the AspectRatio object will be derived from the widthRatio and heightRatio parameters.

    Returns undefined | AspectRatio

  • Parameters

    • width: number
    • height: number
    • Optionalname: string

    Returns undefined | AspectRatio