closest.js 372 B

12345678
  1. import { Point } from '@antv/x6-geometry';
  2. import { resolve } from '../node-anchor/util';
  3. export const getClosestPoint = function (view, magnet, refPoint, options) {
  4. const closestPoint = view.getClosestPoint(refPoint);
  5. return closestPoint != null ? closestPoint : new Point();
  6. };
  7. export const closest = resolve(getClosestPoint);
  8. //# sourceMappingURL=closest.js.map