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

Method _applyPreviewTransform

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

* Applies a `transform` to the preview, taking into account any existing transforms on it. * @param x New transform value along the X axis. * @param y New transform value along the Y axis.

(x: number, y: number)

Source from the content-addressed store, hash-verified

1413 * @param y New transform value along the Y axis.
1414 */
1415 private _applyPreviewTransform(x: number, y: number) {
1416 // Only apply the initial transform if the preview is a clone of the original element, otherwise
1417 // it could be completely different and the transform might not make sense anymore.
1418 const initialTransform = this._previewTemplate?.template ? undefined : this._initialTransform;
1419 const transform = getTransform(x, y);
1420 this._preview!.setTransform(combineTransforms(transform, initialTransform));
1421 }
1422
1423 /**
1424 * Gets the distance that the user has dragged during the current drag sequence.

Callers 2

Calls 3

getTransformFunction · 0.90
combineTransformsFunction · 0.90
setTransformMethod · 0.80

Tested by

no test coverage detected