1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var tslib_1 = require("tslib");
|
4 | var util_1 = require("@antv/util");
|
5 | var base_1 = (0, tslib_1.__importDefault)(require("./base"));
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | var PathMask = (function (_super) {
|
11 | (0, tslib_1.__extends)(PathMask, _super);
|
12 | function PathMask() {
|
13 | return _super !== null && _super.apply(this, arguments) || this;
|
14 | }
|
15 |
|
16 | PathMask.prototype.getMaskPath = function () {
|
17 | var points = this.points;
|
18 | var path = [];
|
19 | if (points.length) {
|
20 | (0, util_1.each)(points, function (point, index) {
|
21 | if (index === 0) {
|
22 | path.push(['M', point.x, point.y]);
|
23 | }
|
24 | else {
|
25 | path.push(['L', point.x, point.y]);
|
26 | }
|
27 | });
|
28 | path.push(['L', points[0].x, points[0].y]);
|
29 | }
|
30 | return path;
|
31 | };
|
32 | PathMask.prototype.getMaskAttrs = function () {
|
33 | return {
|
34 | path: this.getMaskPath(),
|
35 | };
|
36 | };
|
37 | |
38 |
|
39 |
|
40 | PathMask.prototype.addPoint = function () {
|
41 | this.resize();
|
42 | };
|
43 | return PathMask;
|
44 | }(base_1.default));
|
45 | exports.default = PathMask;
|
46 |
|
\ | No newline at end of file |