Function toArray

Converts a rectangle to an array of numbers. See fromNumbers for the opposite conversion.

import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";
const r1 = Rects.toArray({ x: 10, y:20, width: 100, height: 200 });
// [10, 20, 100, 200]
const r2 = Rects.toArray({ width: 100, height: 200 });
// [100, 200]

fromNumbers

  • Converts a rectangle to an array of numbers. See fromNumbers for the opposite conversion.

    import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";

    const r1 = Rects.toArray({ x: 10, y:20, width: 100, height: 200 });
    // [10, 20, 100, 200]
    const r2 = Rects.toArray({ width: 100, height: 200 });
    // [100, 200]

    Parameters

    Returns RectArray

    fromNumbers

  • Converts a rectangle to an array of numbers. See fromNumbers for the opposite conversion.

    import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";

    const r1 = Rects.toArray({ x: 10, y:20, width: 100, height: 200 });
    // [10, 20, 100, 200]
    const r2 = Rects.toArray({ width: 100, height: 200 });
    // [100, 200]

    Parameters

    Returns RectPositionedArray

    fromNumbers