Function multiplyScalar

Multiplies all components of rect by amount. This includes x,y if present.

multiplyScalar({ width:10, height:20 }, 2); // { width:20, height: 40 }
multiplyScalar({ x: 1, y: 2, width:10, height:20 }, 2); // { x: 2, y: 4, width:20, height: 40 }

Use multiplyDim to only multiply width & height.

  • Multiplies all components of rect by amount.

    multiplyScalar({ width:10, height:20 }, 2); // { width:20, height: 40 }
    

    Parameters

    • rect: Rect
    • amount: number

    Returns Rect

  • Multiplies all components of rect by amount. This includes x,y if present.

    multiplyScalar({ width:10, height:20 }, 2); // { width:20, height: 40 }
    multiplyScalar({ x: 1, y: 2, width:10, height:20 }, 2); // { x: 2, y: 4, width:20, height: 40 }

    Parameters

    Returns RectPositioned