1 | import { __decorate } from "tslib";
|
2 | import { singleton } from 'mana-syringe';
|
3 | import { Shape } from '../../types';
|
4 | import { parseNumber, clampedMergeNumbers } from '../parser';
|
5 |
|
6 | var CSSPropertyOffsetDistance =
|
7 |
|
8 | function () {
|
9 | function CSSPropertyOffsetDistance() {
|
10 | this.parser = parseNumber;
|
11 | this.mixer = clampedMergeNumbers(0, 1);
|
12 | }
|
13 |
|
14 | CSSPropertyOffsetDistance.prototype.postProcessor = function (object) {
|
15 | if (!object.attributes.offsetPath) {
|
16 | return;
|
17 | }
|
18 |
|
19 | var offsetPathNodeName = object.attributes.offsetPath.nodeName;
|
20 |
|
21 | if (offsetPathNodeName === Shape.LINE || offsetPathNodeName === Shape.PATH || offsetPathNodeName === Shape.POLYLINE) {
|
22 | var point = object.attributes.offsetPath.getPoint(object.parsedStyle.offsetDistance.value);
|
23 |
|
24 | if (point) {
|
25 | object.setLocalPosition(point.x, point.y);
|
26 | }
|
27 | }
|
28 | };
|
29 |
|
30 | CSSPropertyOffsetDistance = __decorate([singleton()], CSSPropertyOffsetDistance);
|
31 | return CSSPropertyOffsetDistance;
|
32 | }();
|
33 |
|
34 | export { CSSPropertyOffsetDistance }; |
\ | No newline at end of file |