MCPcopy
hub / github.com/fengyuanchen/cropperjs / $translate

Method $translate

packages/element-image/src/index.ts:656–662  ·  view source on GitHub ↗

* Translates the image. * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/translate * @param {number} x The translating distance in the horizontal direction. * @param

(x: number, y: number = x)

Source from the content-addressed store, hash-verified

654 * @returns {CropperImage} Returns `this` for chaining.
655 */
656 $translate(x: number, y: number = x): this {
657 if (this.translatable && isNumber(x) && isNumber(y)) {
658 this.$transform(1, 0, 0, 1, x, y);
659 }
660
661 return this;
662 }
663
664 /**
665 * Transforms the image.

Callers 2

$moveMethod · 0.95
index.spec.tsFile · 0.80

Calls 2

$transformMethod · 0.95
isNumberFunction · 0.90

Tested by

no test coverage detected