MCPcopy Create free account
hub / github.com/angular/components / _getDragDistance

Method _getDragDistance

src/cdk/drag-drop/drag-ref.ts:1426–1434  ·  view source on GitHub ↗

* Gets the distance that the user has dragged during the current drag sequence. * @param currentPosition Current position of the user's pointer.

(currentPosition: Point)

Source from the content-addressed store, hash-verified

1424 * @param currentPosition Current position of the user's pointer.
1425 */
1426 private _getDragDistance(currentPosition: Point): Point {
1427 const pickupPosition = this._pickupPositionOnPage;
1428
1429 if (pickupPosition) {
1430 return {x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y};
1431 }
1432
1433 return {x: 0, y: 0};
1434 }
1435
1436 /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */
1437 private _cleanupCachedDimensions() {

Callers 3

DragRefClass · 0.95
_endDragSequenceMethod · 0.95
_cleanupDragArtifactsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected