Skip to main content

RectFitIntoRect

Callable


  • Transform a rectangle to fit partially or wholly inside another. E.g. an image onto a background canvas


    Parameters

    • sourceRect: Rect

      Source rectangle, to be resized and/or trimmed

    • destRect: Rect

      Destination rectangle, the available space to contain the result

    • sizeMode: number

      How to transform sourceRect - whether to keep original aspect ratio and allow/prevent overflow

    Returns [sourceRectTuple: RectTuple, destRectTuple: RectTuple]

    The subsection of the sourceRect to take and the rectangle to map it to

Index

Methods

Methods

clearCache

  • clearCache(): void
  • Clears the cache of the memoized function


    Returns void

Page Options