Returns a point on the edge of rectangle
import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";const r1 = {x: 10, y: 10, width: 100, height: 50};Rects.getEdgeX(r1, `right`); // Yields: 110Rects.getEdgeX(r1, `bottom`); // Yields: 10const r2 = {width: 100, height: 50};Rects.getEdgeX(r2, `right`); // Yields: 100Rects.getEdgeX(r2, `bottom`); // Yields: 0 Copy
import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";const r1 = {x: 10, y: 10, width: 100, height: 50};Rects.getEdgeX(r1, `right`); // Yields: 110Rects.getEdgeX(r1, `bottom`); // Yields: 10const r2 = {width: 100, height: 50};Rects.getEdgeX(r2, `right`); // Yields: 100Rects.getEdgeX(r2, `bottom`); // Yields: 0
Which edge: right, left, bottom, top
Returns a point on the edge of rectangle