ConnectionLayoutUtil.js 641 B

12345678910111213141516171819202122
  1. import { getAnchorPointAdjustment } from './LayoutUtil';
  2. /**
  3. * @typedef {import('diagram-js/lib/util/Types').Point} Point
  4. *
  5. * @typedef {import('./LayoutUtil').FindNewLineStartIndexHints} FindNewLineStartIndexHints
  6. */
  7. /**
  8. * Calculate the new point after the connection waypoints got updated.
  9. *
  10. * @param {Point} position
  11. * @param {Point[]} newWaypoints
  12. * @param {Point[]} oldWaypoints
  13. * @param {FindNewLineStartIndexHints} hints
  14. *
  15. * @return {Point}
  16. */
  17. export function getConnectionAdjustment(position, newWaypoints, oldWaypoints, hints) {
  18. return getAnchorPointAdjustment(position, newWaypoints, oldWaypoints, hints).point;
  19. }