@mocanvas/editor · function

rangeIntersection

declare function rangeIntersection(a0: number, a1: number, b0: number, b1: number): [number, number] | null

The overlap of the ranges [a0, a1] and [b0, b1], or null when they do not meet. The endpoints of each range may be given in either order.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.