Function subtract

Subtracts width/height from a.

import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";
const rectA = { width: 100, height: 100 };
const rectB = { width: 200, height: 200 };

// Yields: { width: -100, height: -100 }
Rects.subtract(rectA, rectB);
Rects.subtract(rectA, 200, 200);
  • Subtracts width/height of b from a (ie: a - b), returning result.

    import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";
    const rectA = { width: 100, height: 100 };
    const rectB = { width: 200, height: 200 };

    // Yields: { width: -100, height: -100 }
    Rects.subtract(rectA, rectB);

    Parameters

    Returns Rect

  • Parameters

    Returns RectPositioned

  • Subtracts a width/height from a, returning result.

    import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";
    const rect = { width: 100, height: 100 };

    // Yields: { width: -100, height: -100 }
    Rects.subtract(rect, 200, 200);

    Parameters

    • a: Rect
    • width: number
    • height: number

    Returns Rect

  • Parameters

    Returns RectPositioned