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

    Function closestPointOnEdge

    • Function

      closestPointOnEdge

      Parameters

      • pointer: Coordinate

        The point to measure from.

      • rect: DOMRect

        The rectangle to measure against.

      Returns Point

      A new point on the rectangle's outline; neither argument is modified.

      Find the point on a rectangle's outline nearest to a given point. Unlike closestPointOnAabb, a point inside the rectangle is pushed out to the nearest edge rather than returned as-is, so the result always sits on the border.