export function getClosestPoint()

in src/shapes/shapes.ts [149:154]


    export function getClosestPoint(rect: IRect, x: number, y: number): IPoint {
        return {
            x: Math.min(Math.max(rect.left, x), rect.left + rect.width),
            y: Math.min(Math.max(rect.top, y), rect.top + rect.height)
        };
    }