ixfx
    Preparing search index...

    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 Geometry.Rect

    • 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);

      Returns Geometry.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 };
      Rects.subtract(rect, 200, 200);
      // Yields: { width: -100, height: -100 }

      Parameters

      Returns Geometry.Rect

    • 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 Geometry.RectPositioned