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

Method _applyPreviewTransform

src/cdk/drag-drop/drag-ref.ts:1414–1420  ·  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

1412 * @param y New transform value along the Y axis.
1413 */
1414 private _applyPreviewTransform(x: number, y: number) {
1415 // Only apply the initial transform if the preview is a clone of the original element, otherwise
1416 // it could be completely different and the transform might not make sense anymore.
1417 const initialTransform = this._previewTemplate?.template ? undefined : this._initialTransform;
1418 const transform = getTransform(x, y);
1419 this._preview!.setTransform(combineTransforms(transform, initialTransform));
1420 }
1421
1422 /**
1423 * 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