UNPKG

1.15 kBJavaScriptView Raw
1import { __extends } from "tslib";
2import { CSSTransformComponent } from './CSSTransformComponent'; // import { UnitType } from './types';
3
4/**
5 * Represents a translation value in a CSSTransformValue
6 * used for properties like "transform".
7 *
8 * @see https://drafts.css-houdini.org/css-typed-om/#csstranslate
9 */
10
11var CSSTranslate =
12/** @class */
13function (_super) {
14 __extends(CSSTranslate, _super);
15
16 function CSSTranslate(x, y, z, is2D) {
17 var _this = _super.call(this, is2D) || this;
18
19 _this.x = x;
20 _this.y = y;
21 _this.z = z;
22 return _this;
23 }
24
25 CSSTranslate.prototype.toMatrix = function () {
26 // const x = this.x.to(UnitType.kPixels);
27 // const y = this.y.to(UnitType.kPixels);
28 // const z = this.z.to(UnitType.kPixels);
29 // let matrix: DOMMatrix;
30 // if (this.is2D) {
31 // matrix = new DOMMatrix([1, 0, 0, 1, 0, 0]);
32 // matrix.translateSelf(x.value, y.value);
33 // } else {
34 // matrix = new DOMMatrix();
35 // matrix.translateSelf(x.value, y.value, z.value);
36 // }
37 // return matrix;
38 return null;
39 };
40
41 return CSSTranslate;
42}(CSSTransformComponent);
43
44export { CSSTranslate };
\No newline at end of file