gradum-kit - v0.1.0
    Preparing search index...

    Function closestPointOnAabb

    • Function

      closestPointOnAabb

      Parameters

      • p: Point

        The point to measure from.

      • r: DOMRect

        The rectangle to measure against.

      Returns Point

      A new point; neither argument is modified.

      Find the point of an axis-aligned rectangle nearest to a given point. A point already inside the rectangle is returned unchanged, so the result is the point itself rather than a point on the border — use closestPointOnEdge when you always want a point on the outline.