1 | import { __decorate } from "tslib";
|
2 | import { singleton } from 'mana-syringe';
|
3 | import { Rectangle } from '../../shapes';
|
4 | import { CSSKeywordValue } from '../cssom';
|
5 | import { parsePath, mergePaths } from '../parser';
|
6 |
|
7 | var CSSPropertyPath =
|
8 |
|
9 | function () {
|
10 | function CSSPropertyPath() {
|
11 | |
12 |
|
13 |
|
14 | this.parser = parsePath;
|
15 | this.mixer = mergePaths;
|
16 | }
|
17 |
|
18 | CSSPropertyPath.prototype.calculator = function (name, oldParsed, parsed) {
|
19 |
|
20 | if (parsed instanceof CSSKeywordValue && parsed.value === 'unset') {
|
21 | return {
|
22 | absolutePath: [],
|
23 | hasArc: false,
|
24 | segments: [],
|
25 | polygons: [],
|
26 | polylines: [],
|
27 | curve: [],
|
28 | totalLength: 0,
|
29 | curveSegments: [],
|
30 | zCommandIndexes: [],
|
31 | rect: new Rectangle(0, 0, 0, 0)
|
32 | };
|
33 | }
|
34 |
|
35 | return parsed;
|
36 | };
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 | CSSPropertyPath.prototype.postProcessor = function (object) {
|
43 | var _a = object.parsedStyle,
|
44 | _b = _a.defX,
|
45 | defX = _b === void 0 ? 0 : _b,
|
46 | _c = _a.defY,
|
47 | defY = _c === void 0 ? 0 : _c;
|
48 | object.setLocalPosition(defX, defY);
|
49 | };
|
50 |
|
51 | CSSPropertyPath = __decorate([singleton()], CSSPropertyPath);
|
52 | return CSSPropertyPath;
|
53 | }();
|
54 |
|
55 | export { CSSPropertyPath }; |
\ | No newline at end of file |