MCPcopy Index your code
hub / github.com/apache/echarts / nearestPointOnRect

Function nearestPointOnRect

src/label/labelGuideHelper.ts:201–208  ·  view source on GitHub ↗
(pt: Point, rect: RectLike, out: Point)

Source from the content-addressed store, hash-verified

199const tmpPt: number[] = [];
200
201function nearestPointOnRect(pt: Point, rect: RectLike, out: Point) {
202 const dist = projectPointToRect(
203 rect.x, rect.y, rect.width, rect.height,
204 pt.x, pt.y, tmpPt
205 );
206 out.set(tmpPt[0], tmpPt[1]);
207 return dist;
208}
209/**
210 * Calculate min distance corresponding point.
211 * This method won't evaluate if point is in the path.

Callers 1

updateLabelLinePointsFunction · 0.85

Calls 1

projectPointToRectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…