Skip to main content

ViewBox

Index

Constructors

constructor

  • new ViewBox(x?: any, y?: string | number, width?: string | number, height?: string | number): ViewBox
  • Parameters

    • optionalx: any
    • optionaly: string | number
    • optionalwidth: string | number
    • optionalheight: string | number

    Returns ViewBox

Properties

height

height: number = 0

initialized

initialized: boolean = false

width

width: number = 0

x

x: number = 0

y

y: number = 0

Methods

addPadding

  • addPadding(padding: { bottom: number; left: number; right: number; top: number }): void
  • Adds padding to the viewBox


    Parameters

    • padding: { bottom: number; left: number; right: number; top: number }

    Returns void

clone

fitsInViewBox

  • fitsInViewBox(viewBox: ViewBox, atLeastByOneDimension?: boolean): boolean
  • Check whether current viewBox fits inside of another viewBox


    Parameters

    • viewBox: ViewBox
    • optionalatLeastByOneDimension: boolean

    Returns boolean

toArray

  • toArray(): number[]
  • Returns an array containing viewBox numbers


    Returns number[]

toString

  • toString(): string
  • Returns a string with viewBox numbers


    Returns string

update

  • update(x: any, y?: string | number, width?: string | number, height?: string | number): void
  • Updates viewbox with new numbers


    Parameters

    • x: any
    • optionaly: string | number
    • optionalwidth: string | number
    • optionalheight: string | number

    Returns void