@visactor/vrender 0.18.0-alpha.0 → 0.18.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +1745 -1183
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2149,15 +2149,15 @@
|
|
|
2149
2149
|
};
|
|
2150
2150
|
var isArray$1 = isArray;
|
|
2151
2151
|
|
|
2152
|
-
var isNumber
|
|
2152
|
+
var isNumber = function isNumber(value) {
|
|
2153
2153
|
var fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
2154
2154
|
var type = _typeof(value);
|
|
2155
2155
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
2156
2156
|
};
|
|
2157
|
-
var isNumber$
|
|
2157
|
+
var isNumber$1 = isNumber;
|
|
2158
2158
|
|
|
2159
2159
|
var isValidNumber = function isValidNumber(value) {
|
|
2160
|
-
return isNumber$
|
|
2160
|
+
return isNumber$1(value) && Number.isFinite(value);
|
|
2161
2161
|
};
|
|
2162
2162
|
var isValidNumber$1 = isValidNumber;
|
|
2163
2163
|
|
|
@@ -2264,12 +2264,12 @@
|
|
|
2264
2264
|
}, {
|
|
2265
2265
|
key: "add",
|
|
2266
2266
|
value: function add(point) {
|
|
2267
|
-
return isNumber$
|
|
2267
|
+
return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
2268
2268
|
}
|
|
2269
2269
|
}, {
|
|
2270
2270
|
key: "sub",
|
|
2271
2271
|
value: function sub(point) {
|
|
2272
|
-
return isNumber$
|
|
2272
|
+
return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
2273
2273
|
}
|
|
2274
2274
|
}, {
|
|
2275
2275
|
key: "multi",
|
|
@@ -2973,10 +2973,10 @@
|
|
|
2973
2973
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2974
2974
|
}
|
|
2975
2975
|
function rgb(value) {
|
|
2976
|
-
return isNumber$
|
|
2976
|
+
return isNumber$1(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
2977
2977
|
}
|
|
2978
2978
|
function rgba(value) {
|
|
2979
|
-
return isNumber$
|
|
2979
|
+
return isNumber$1(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
2980
2980
|
}
|
|
2981
2981
|
function SRGBToLinear(c) {
|
|
2982
2982
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -3657,7 +3657,7 @@
|
|
|
3657
3657
|
}], [{
|
|
3658
3658
|
key: "getInstance",
|
|
3659
3659
|
value: function getInstance(level, method) {
|
|
3660
|
-
return Logger._instance && isNumber$
|
|
3660
|
+
return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
3661
3661
|
}
|
|
3662
3662
|
}, {
|
|
3663
3663
|
key: "setInstance",
|
|
@@ -4278,6 +4278,10 @@
|
|
|
4278
4278
|
var defined0 = !1;
|
|
4279
4279
|
for (var i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
4280
4280
|
}
|
|
4281
|
+
function genSegContext(curveType, direction, points) {
|
|
4282
|
+
var curveDirection = null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN;
|
|
4283
|
+
return "monotoneY" === curveType ? new ReflectSegContext(curveType, curveDirection) : new SegContext(curveType, curveDirection);
|
|
4284
|
+
}
|
|
4281
4285
|
|
|
4282
4286
|
var Linear = /*#__PURE__*/function () {
|
|
4283
4287
|
function Linear(context, startPoint) {
|
|
@@ -4333,7 +4337,7 @@
|
|
|
4333
4337
|
var direction = params.direction,
|
|
4334
4338
|
startPoint = params.startPoint;
|
|
4335
4339
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
4336
|
-
var segContext =
|
|
4340
|
+
var segContext = genSegContext("linear", direction, points);
|
|
4337
4341
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
4338
4342
|
}
|
|
4339
4343
|
function genLinearTypeSegments(path, points) {
|
|
@@ -4403,7 +4407,7 @@
|
|
|
4403
4407
|
startPoint = params.startPoint;
|
|
4404
4408
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
4405
4409
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
4406
|
-
var segContext =
|
|
4410
|
+
var segContext = genSegContext("basis", direction, points);
|
|
4407
4411
|
return genBasisTypeSegments(new Basis(segContext, startPoint), points), segContext;
|
|
4408
4412
|
}
|
|
4409
4413
|
|
|
@@ -4510,7 +4514,7 @@
|
|
|
4510
4514
|
}]);
|
|
4511
4515
|
return MonotoneY;
|
|
4512
4516
|
}(MonotoneX);
|
|
4513
|
-
function
|
|
4517
|
+
function genMonotoneXTypeSegments(path, points) {
|
|
4514
4518
|
return genCurveSegments(path, points);
|
|
4515
4519
|
}
|
|
4516
4520
|
function genMonotoneXSegments(points) {
|
|
@@ -4519,10 +4523,10 @@
|
|
|
4519
4523
|
startPoint = params.startPoint;
|
|
4520
4524
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
4521
4525
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
4522
|
-
var segContext =
|
|
4523
|
-
return
|
|
4526
|
+
var segContext = genSegContext("monotoneX", direction, points);
|
|
4527
|
+
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
4524
4528
|
}
|
|
4525
|
-
function
|
|
4529
|
+
function genMonotoneYTypeSegments(path, points) {
|
|
4526
4530
|
return genCurveSegments(path, points);
|
|
4527
4531
|
}
|
|
4528
4532
|
function genMonotoneYSegments(points) {
|
|
@@ -4531,8 +4535,8 @@
|
|
|
4531
4535
|
startPoint = params.startPoint;
|
|
4532
4536
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
4533
4537
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
4534
|
-
var segContext =
|
|
4535
|
-
return
|
|
4538
|
+
var segContext = genSegContext("monotoneY", direction, points);
|
|
4539
|
+
return genMonotoneYTypeSegments(new MonotoneY(segContext, startPoint), points), segContext;
|
|
4536
4540
|
}
|
|
4537
4541
|
|
|
4538
4542
|
var Step$1 = /*#__PURE__*/function () {
|
|
@@ -4601,61 +4605,27 @@
|
|
|
4601
4605
|
return genCurveSegments(path, points);
|
|
4602
4606
|
}
|
|
4603
4607
|
|
|
4604
|
-
var LinearClosed = /*#__PURE__*/function () {
|
|
4605
|
-
|
|
4608
|
+
var LinearClosed = /*#__PURE__*/function (_Linear) {
|
|
4609
|
+
_inherits(LinearClosed, _Linear);
|
|
4610
|
+
var _super = _createSuper(LinearClosed);
|
|
4611
|
+
function LinearClosed() {
|
|
4606
4612
|
_classCallCheck(this, LinearClosed);
|
|
4607
|
-
|
|
4613
|
+
return _super.apply(this, arguments);
|
|
4608
4614
|
}
|
|
4609
4615
|
_createClass(LinearClosed, [{
|
|
4610
|
-
key: "areaStart",
|
|
4611
|
-
value: function areaStart() {
|
|
4612
|
-
this._line = 0;
|
|
4613
|
-
}
|
|
4614
|
-
}, {
|
|
4615
|
-
key: "areaEnd",
|
|
4616
|
-
value: function areaEnd() {
|
|
4617
|
-
this._line = NaN;
|
|
4618
|
-
}
|
|
4619
|
-
}, {
|
|
4620
|
-
key: "lineStart",
|
|
4621
|
-
value: function lineStart() {
|
|
4622
|
-
this._point = 0, this.startPoint && this.point(this.startPoint);
|
|
4623
|
-
}
|
|
4624
|
-
}, {
|
|
4625
4616
|
key: "lineEnd",
|
|
4626
4617
|
value: function lineEnd() {
|
|
4627
4618
|
this.context.closePath();
|
|
4628
4619
|
}
|
|
4629
|
-
}, {
|
|
4630
|
-
key: "point",
|
|
4631
|
-
value: function point(p) {
|
|
4632
|
-
var x = p.x,
|
|
4633
|
-
y = p.y;
|
|
4634
|
-
switch (this._point) {
|
|
4635
|
-
case 0:
|
|
4636
|
-
this._point = 1, this._line ? this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p) : this.context.moveTo(x, y, p);
|
|
4637
|
-
break;
|
|
4638
|
-
case 1:
|
|
4639
|
-
this._point = 2;
|
|
4640
|
-
default:
|
|
4641
|
-
this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
4642
|
-
}
|
|
4643
|
-
this._lastDefined = p.defined;
|
|
4644
|
-
}
|
|
4645
|
-
}, {
|
|
4646
|
-
key: "tryUpdateLength",
|
|
4647
|
-
value: function tryUpdateLength() {
|
|
4648
|
-
return this.context.tryUpdateLength();
|
|
4649
|
-
}
|
|
4650
4620
|
}]);
|
|
4651
4621
|
return LinearClosed;
|
|
4652
|
-
}();
|
|
4622
|
+
}(Linear);
|
|
4653
4623
|
function genLinearClosedSegments(points) {
|
|
4654
4624
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
4655
4625
|
var direction = params.direction,
|
|
4656
4626
|
startPoint = params.startPoint;
|
|
4657
4627
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
4658
|
-
var segContext =
|
|
4628
|
+
var segContext = genSegContext("linear", direction, points);
|
|
4659
4629
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
4660
4630
|
}
|
|
4661
4631
|
function genLinearClosedTypeSegments(path, points) {
|
|
@@ -5188,11 +5158,13 @@
|
|
|
5188
5158
|
var DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
5189
5159
|
opacity: 1,
|
|
5190
5160
|
background: null,
|
|
5161
|
+
backgroundCornerRadius: 0,
|
|
5191
5162
|
texture: null,
|
|
5192
5163
|
textureColor: "black",
|
|
5193
5164
|
textureSize: 10,
|
|
5194
5165
|
texturePadding: 2,
|
|
5195
5166
|
backgroundMode: "no-repeat",
|
|
5167
|
+
backgroundFit: !0,
|
|
5196
5168
|
blur: 0,
|
|
5197
5169
|
cursor: null,
|
|
5198
5170
|
html: null
|
|
@@ -5210,6 +5182,8 @@
|
|
|
5210
5182
|
strokeSeg: null,
|
|
5211
5183
|
pickable: !0,
|
|
5212
5184
|
childrenPickable: !0,
|
|
5185
|
+
fillPickable: !0,
|
|
5186
|
+
strokePickable: !0,
|
|
5213
5187
|
visible: !0,
|
|
5214
5188
|
zIndex: 0,
|
|
5215
5189
|
layout: null,
|
|
@@ -5319,7 +5293,7 @@
|
|
|
5319
5293
|
strokeBoundsBuffer: 0,
|
|
5320
5294
|
keepDirIn3d: !0
|
|
5321
5295
|
});
|
|
5322
|
-
var DefaultRichTextAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
5296
|
+
var DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), {
|
|
5323
5297
|
width: 300,
|
|
5324
5298
|
height: 300,
|
|
5325
5299
|
ellipsis: !0,
|
|
@@ -5823,9 +5797,6 @@
|
|
|
5823
5797
|
function isNotAroundZero(val) {
|
|
5824
5798
|
return val > EPSILON || val < -EPSILON;
|
|
5825
5799
|
}
|
|
5826
|
-
function isNumber(data) {
|
|
5827
|
-
return "number" == typeof data && Number.isFinite(data);
|
|
5828
|
-
}
|
|
5829
5800
|
var _v0 = [0, 0],
|
|
5830
5801
|
_v1 = [0, 0],
|
|
5831
5802
|
_v2 = [0, 0];
|
|
@@ -6736,7 +6707,7 @@
|
|
|
6736
6707
|
}();
|
|
6737
6708
|
var globalTheme = new Theme();
|
|
6738
6709
|
function getTheme(graphic, theme) {
|
|
6739
|
-
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
|
|
6710
|
+
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
6740
6711
|
}
|
|
6741
6712
|
function getThemeFromGroup(graphic) {
|
|
6742
6713
|
var g;
|
|
@@ -7000,10 +6971,13 @@
|
|
|
7000
6971
|
}
|
|
7001
6972
|
}, {
|
|
7002
6973
|
key: "removeAllChild",
|
|
7003
|
-
value: function removeAllChild() {
|
|
6974
|
+
value: function removeAllChild(deep) {
|
|
7004
6975
|
if (!this._idMap) return;
|
|
7005
6976
|
var child = this._firstChild;
|
|
7006
|
-
for (; child;)
|
|
6977
|
+
for (; child;) {
|
|
6978
|
+
var next = child._next;
|
|
6979
|
+
child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
|
|
6980
|
+
}
|
|
7007
6981
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
7008
6982
|
}
|
|
7009
6983
|
}, {
|
|
@@ -7886,10 +7860,14 @@
|
|
|
7886
7860
|
viewport = params.viewport,
|
|
7887
7861
|
_params$autoPreventDe = params.autoPreventDefault,
|
|
7888
7862
|
autoPreventDefault = _params$autoPreventDe === void 0 ? !1 : _params$autoPreventDe,
|
|
7889
|
-
clickInterval = params.clickInterval
|
|
7863
|
+
clickInterval = params.clickInterval,
|
|
7864
|
+
_params$supportsTouch = params.supportsTouchEvents,
|
|
7865
|
+
supportsTouchEvents = _params$supportsTouch === void 0 ? global.supportsTouchEvents : _params$supportsTouch,
|
|
7866
|
+
_params$supportsPoint = params.supportsPointerEvents,
|
|
7867
|
+
supportsPointerEvents = _params$supportsPoint === void 0 ? global.supportsPointerEvents : _params$supportsPoint;
|
|
7890
7868
|
this.manager = new EventManager(rootNode, {
|
|
7891
7869
|
clickInterval: clickInterval
|
|
7892
|
-
}), this.globalObj = global, this.supportsPointerEvents =
|
|
7870
|
+
}), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
|
|
7893
7871
|
"default": "inherit",
|
|
7894
7872
|
pointer: "pointer"
|
|
7895
7873
|
}, this.resolution = resolution, this.setTargetElement(targetElement);
|
|
@@ -9265,7 +9243,7 @@
|
|
|
9265
9243
|
key: "onBind",
|
|
9266
9244
|
value: function onBind() {
|
|
9267
9245
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9268
|
-
this.fromNumber = isNumber$
|
|
9246
|
+
this.fromNumber = isNumber$1(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$1(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
|
|
9269
9247
|
}
|
|
9270
9248
|
}, {
|
|
9271
9249
|
key: "onEnd",
|
|
@@ -10583,6 +10561,25 @@
|
|
|
10583
10561
|
return path;
|
|
10584
10562
|
}
|
|
10585
10563
|
|
|
10564
|
+
var normalizeRectAttributes = function normalizeRectAttributes(attribute) {
|
|
10565
|
+
if (!attribute) return {
|
|
10566
|
+
x: 0,
|
|
10567
|
+
y: 0,
|
|
10568
|
+
width: 0,
|
|
10569
|
+
height: 0
|
|
10570
|
+
};
|
|
10571
|
+
var width = isNil$1(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
|
|
10572
|
+
height = isNil$1(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
|
|
10573
|
+
x = 0,
|
|
10574
|
+
y = 0;
|
|
10575
|
+
return width < 0 ? (x = width, width = -width) : Number.isNaN(width) && (width = 0), height < 0 ? (y = height, height = -height) : Number.isNaN(height) && (height = 0), {
|
|
10576
|
+
x: x,
|
|
10577
|
+
y: y,
|
|
10578
|
+
width: width,
|
|
10579
|
+
height: height
|
|
10580
|
+
};
|
|
10581
|
+
};
|
|
10582
|
+
|
|
10586
10583
|
function splitToGrids(width, height, count) {
|
|
10587
10584
|
var ratio = width / height;
|
|
10588
10585
|
var rowCount, columnCount;
|
|
@@ -10594,8 +10591,9 @@
|
|
|
10594
10591
|
return grids;
|
|
10595
10592
|
}
|
|
10596
10593
|
var splitRect = function splitRect(rect, count) {
|
|
10597
|
-
var
|
|
10598
|
-
|
|
10594
|
+
var _normalizeRectAttribu = normalizeRectAttributes(rect.attribute),
|
|
10595
|
+
width = _normalizeRectAttribu.width,
|
|
10596
|
+
height = _normalizeRectAttribu.height,
|
|
10599
10597
|
grids = splitToGrids(width, height, count),
|
|
10600
10598
|
res = [],
|
|
10601
10599
|
gridHeight = height / grids.length;
|
|
@@ -10656,7 +10654,7 @@
|
|
|
10656
10654
|
};
|
|
10657
10655
|
var samplingPoints = function samplingPoints(points, count) {
|
|
10658
10656
|
var validatePoints = points.filter(function (point) {
|
|
10659
|
-
return !1 !== point.defined && isNumber$
|
|
10657
|
+
return !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y);
|
|
10660
10658
|
});
|
|
10661
10659
|
if (0 === validatePoints.length) return [];
|
|
10662
10660
|
if (1 === validatePoints.length) return new Array(count).fill(0).map(function (i) {
|
|
@@ -10696,7 +10694,7 @@
|
|
|
10696
10694
|
return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
|
|
10697
10695
|
}, []));
|
|
10698
10696
|
var validatePoints = points.filter(function (point) {
|
|
10699
|
-
return !1 !== point.defined && isNumber$
|
|
10697
|
+
return !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y);
|
|
10700
10698
|
});
|
|
10701
10699
|
if (!validatePoints.length) return [];
|
|
10702
10700
|
var allPoints = [];
|
|
@@ -11363,15 +11361,7 @@
|
|
|
11363
11361
|
var data = ResourceLoader.cache.get(url);
|
|
11364
11362
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
|
|
11365
11363
|
mark.imageLoadFail(url);
|
|
11366
|
-
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (
|
|
11367
|
-
type: "image",
|
|
11368
|
-
loadState: "init"
|
|
11369
|
-
}, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
|
|
11370
|
-
var _a;
|
|
11371
|
-
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
|
|
11372
|
-
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
11373
|
-
});
|
|
11374
|
-
})) : (data.loadState = "fail", mark.imageLoadFail(url)));
|
|
11364
|
+
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
|
|
11375
11365
|
}
|
|
11376
11366
|
}, {
|
|
11377
11367
|
key: "GetSvg",
|
|
@@ -11405,10 +11395,68 @@
|
|
|
11405
11395
|
return data.data;
|
|
11406
11396
|
}));
|
|
11407
11397
|
}
|
|
11398
|
+
}, {
|
|
11399
|
+
key: "loading",
|
|
11400
|
+
value: function loading() {
|
|
11401
|
+
setTimeout(function () {
|
|
11402
|
+
if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
|
|
11403
|
+
ResourceLoader.isLoading = !0;
|
|
11404
|
+
var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
|
|
11405
|
+
promises = [];
|
|
11406
|
+
tasks.forEach(function (task) {
|
|
11407
|
+
var url = task.url,
|
|
11408
|
+
marks = task.marks,
|
|
11409
|
+
data = {
|
|
11410
|
+
type: "image",
|
|
11411
|
+
loadState: "init"
|
|
11412
|
+
};
|
|
11413
|
+
if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
|
|
11414
|
+
data.waitingMark = marks;
|
|
11415
|
+
var end = data.dataPromise.then(function (res) {
|
|
11416
|
+
var _a;
|
|
11417
|
+
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
|
|
11418
|
+
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
11419
|
+
});
|
|
11420
|
+
});
|
|
11421
|
+
promises.push(end);
|
|
11422
|
+
} else data.loadState = "fail", marks.forEach(function (mark) {
|
|
11423
|
+
return mark.imageLoadFail(url);
|
|
11424
|
+
});
|
|
11425
|
+
}), Promise.all(promises).then(function () {
|
|
11426
|
+
ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11427
|
+
})["catch"](function (error) {
|
|
11428
|
+
console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11429
|
+
});
|
|
11430
|
+
}
|
|
11431
|
+
}, 0);
|
|
11432
|
+
}
|
|
11433
|
+
}, {
|
|
11434
|
+
key: "loadImage",
|
|
11435
|
+
value: function loadImage(url, mark) {
|
|
11436
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11437
|
+
if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
|
|
11438
|
+
ResourceLoader.toLoadAueue.push({
|
|
11439
|
+
url: url,
|
|
11440
|
+
marks: [mark]
|
|
11441
|
+
}), ResourceLoader.loading();
|
|
11442
|
+
}
|
|
11443
|
+
}, {
|
|
11444
|
+
key: "improveImageLoading",
|
|
11445
|
+
value: function improveImageLoading(url) {
|
|
11446
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11447
|
+
if (-1 !== index) {
|
|
11448
|
+
var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
|
|
11449
|
+
ResourceLoader.toLoadAueue.unshift(elememt[0]);
|
|
11450
|
+
}
|
|
11451
|
+
}
|
|
11408
11452
|
}]);
|
|
11409
11453
|
return ResourceLoader;
|
|
11410
11454
|
}();
|
|
11411
|
-
|
|
11455
|
+
function getIndex(url, arr) {
|
|
11456
|
+
for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
|
|
11457
|
+
return -1;
|
|
11458
|
+
}
|
|
11459
|
+
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
11412
11460
|
|
|
11413
11461
|
var tempMatrix = new Matrix(),
|
|
11414
11462
|
tempBounds$1 = new AABBBounds();
|
|
@@ -11454,7 +11502,8 @@
|
|
|
11454
11502
|
var _this;
|
|
11455
11503
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11456
11504
|
_classCallCheck(this, Graphic);
|
|
11457
|
-
|
|
11505
|
+
var _a;
|
|
11506
|
+
_this = _super.call(this), _this._AABBBounds = new AABBBounds(), _this._updateTag = exports.UpdateTag.INIT, _this.attribute = params, _this.valid = _this.isValid(), params.background && _this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0);
|
|
11458
11507
|
return _this;
|
|
11459
11508
|
}
|
|
11460
11509
|
_createClass(Graphic, [{
|
|
@@ -11525,7 +11574,7 @@
|
|
|
11525
11574
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
11526
11575
|
application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
11527
11576
|
var bounds = this.doUpdateAABBBounds(full);
|
|
11528
|
-
return
|
|
11577
|
+
return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
|
|
11529
11578
|
}
|
|
11530
11579
|
}, {
|
|
11531
11580
|
key: "combindShadowAABBBounds",
|
|
@@ -11538,7 +11587,8 @@
|
|
|
11538
11587
|
}, {
|
|
11539
11588
|
key: "tryUpdateGlobalAABBBounds",
|
|
11540
11589
|
value: function tryUpdateGlobalAABBBounds() {
|
|
11541
|
-
|
|
11590
|
+
var b = this.AABBBounds;
|
|
11591
|
+
return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
|
|
11542
11592
|
}
|
|
11543
11593
|
}, {
|
|
11544
11594
|
key: "tryUpdateGlobalTransMatrix",
|
|
@@ -11663,7 +11713,7 @@
|
|
|
11663
11713
|
var context = {
|
|
11664
11714
|
type: exports.AttributeUpdateType.INIT
|
|
11665
11715
|
};
|
|
11666
|
-
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), this._updateTag = exports.UpdateTag.INIT, this.onAttributeUpdate(context);
|
|
11716
|
+
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), this._updateTag = exports.UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
|
|
11667
11717
|
}
|
|
11668
11718
|
}, {
|
|
11669
11719
|
key: "translate",
|
|
@@ -12193,7 +12243,7 @@
|
|
|
12193
12243
|
data: "init",
|
|
12194
12244
|
state: null
|
|
12195
12245
|
};
|
|
12196
|
-
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
|
|
12246
|
+
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$1(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
|
|
12197
12247
|
}
|
|
12198
12248
|
}, {
|
|
12199
12249
|
key: "imageLoadSuccess",
|
|
@@ -12767,7 +12817,7 @@
|
|
|
12767
12817
|
value: function doUpdateAABBBounds() {
|
|
12768
12818
|
var attribute = this.attribute,
|
|
12769
12819
|
groupTheme = getTheme(this).group;
|
|
12770
|
-
this._AABBBounds.
|
|
12820
|
+
this._AABBBounds.clear();
|
|
12771
12821
|
var bounds = application.graphicService.updateGroupAABBBounds(attribute, groupTheme, this._AABBBounds, this),
|
|
12772
12822
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
12773
12823
|
boundsPadding = _attribute$boundsPadd === void 0 ? groupTheme.boundsPadding : _attribute$boundsPadd,
|
|
@@ -12844,8 +12894,9 @@
|
|
|
12844
12894
|
}, {
|
|
12845
12895
|
key: "removeAllChild",
|
|
12846
12896
|
value: function removeAllChild() {
|
|
12897
|
+
var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
12847
12898
|
this.forEachChildren(function (child) {
|
|
12848
|
-
application.graphicService.onRemove(child);
|
|
12899
|
+
application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
12849
12900
|
}), _get(_getPrototypeOf(Group.prototype), "removeAllChild", this).call(this), this.addUpdateBoundTag();
|
|
12850
12901
|
}
|
|
12851
12902
|
}, {
|
|
@@ -13588,7 +13639,7 @@
|
|
|
13588
13639
|
key: "doUpdateAABBBounds",
|
|
13589
13640
|
value: function doUpdateAABBBounds(full) {
|
|
13590
13641
|
var circleTheme = getTheme(this).circle;
|
|
13591
|
-
this._AABBBounds.
|
|
13642
|
+
this._AABBBounds.clear();
|
|
13592
13643
|
var attribute = this.attribute,
|
|
13593
13644
|
bounds = application.graphicService.updateCircleAABBBounds(attribute, getTheme(this).circle, this._AABBBounds, full, this),
|
|
13594
13645
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -13775,7 +13826,7 @@
|
|
|
13775
13826
|
return CanvasTextLayout;
|
|
13776
13827
|
}();
|
|
13777
13828
|
|
|
13778
|
-
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
13829
|
+
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
13779
13830
|
var Text = /*#__PURE__*/function (_Graphic) {
|
|
13780
13831
|
_inherits(Text, _Graphic);
|
|
13781
13832
|
var _super = _createSuper(Text);
|
|
@@ -13816,10 +13867,12 @@
|
|
|
13816
13867
|
get: function get() {
|
|
13817
13868
|
var textTheme = getTheme(this).text,
|
|
13818
13869
|
attribute = this.attribute;
|
|
13819
|
-
if (
|
|
13870
|
+
if (this.isMultiLine) return;
|
|
13820
13871
|
var _attribute$maxLineWid2 = attribute.maxLineWidth,
|
|
13821
13872
|
maxLineWidth = _attribute$maxLineWid2 === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid2;
|
|
13822
|
-
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(),
|
|
13873
|
+
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(function (item) {
|
|
13874
|
+
return item.text;
|
|
13875
|
+
}).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
13823
13876
|
}
|
|
13824
13877
|
}, {
|
|
13825
13878
|
key: "multilineLayout",
|
|
@@ -13853,7 +13906,7 @@
|
|
|
13853
13906
|
key: "doUpdateAABBBounds",
|
|
13854
13907
|
value: function doUpdateAABBBounds() {
|
|
13855
13908
|
var textTheme = getTheme(this).text;
|
|
13856
|
-
this._AABBBounds.
|
|
13909
|
+
this._AABBBounds.clear();
|
|
13857
13910
|
var attribute = this.attribute,
|
|
13858
13911
|
bounds = application.graphicService.updateTextAABBBounds(attribute, textTheme, this._AABBBounds, this),
|
|
13859
13912
|
_this$attribute$bound = this.attribute.boundsPadding,
|
|
@@ -14509,7 +14562,7 @@
|
|
|
14509
14562
|
_createClass(BaseSymbol, [{
|
|
14510
14563
|
key: "bounds",
|
|
14511
14564
|
value: function bounds(size, _bounds) {
|
|
14512
|
-
if (isNumber$
|
|
14565
|
+
if (isNumber$1(size)) {
|
|
14513
14566
|
var halfS = size / 2;
|
|
14514
14567
|
_bounds.x1 = -halfS, _bounds.x2 = halfS, _bounds.y1 = -halfS, _bounds.y2 = halfS;
|
|
14515
14568
|
} else _bounds.x1 = -size[0] / 2, _bounds.x2 = size[0] / 2, _bounds.y1 = -size[1] / 2, _bounds.y2 = size[1] / 2;
|
|
@@ -15196,12 +15249,12 @@
|
|
|
15196
15249
|
_createClass(RectSymbol, [{
|
|
15197
15250
|
key: "draw",
|
|
15198
15251
|
value: function draw(ctx, size, x, y) {
|
|
15199
|
-
return isNumber$
|
|
15252
|
+
return isNumber$1(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
15200
15253
|
}
|
|
15201
15254
|
}, {
|
|
15202
15255
|
key: "drawOffset",
|
|
15203
15256
|
value: function drawOffset(ctx, size, x, y, offset) {
|
|
15204
|
-
return isNumber$
|
|
15257
|
+
return isNumber$1(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
15205
15258
|
}
|
|
15206
15259
|
}]);
|
|
15207
15260
|
return RectSymbol;
|
|
@@ -15332,7 +15385,7 @@
|
|
|
15332
15385
|
key: "doUpdateAABBBounds",
|
|
15333
15386
|
value: function doUpdateAABBBounds(full) {
|
|
15334
15387
|
var symbolTheme = getTheme(this).symbol;
|
|
15335
|
-
this._AABBBounds.
|
|
15388
|
+
this._AABBBounds.clear();
|
|
15336
15389
|
var attribute = this.attribute,
|
|
15337
15390
|
bounds = application.graphicService.updateSymbolAABBBounds(attribute, getTheme(this).symbol, this._AABBBounds, full, this),
|
|
15338
15391
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -15422,7 +15475,7 @@
|
|
|
15422
15475
|
key: "doUpdateAABBBounds",
|
|
15423
15476
|
value: function doUpdateAABBBounds() {
|
|
15424
15477
|
var lineTheme = getTheme(this).line;
|
|
15425
|
-
this._AABBBounds.
|
|
15478
|
+
this._AABBBounds.clear();
|
|
15426
15479
|
var attribute = this.attribute,
|
|
15427
15480
|
bounds = application.graphicService.updateLineAABBBounds(attribute, getTheme(this).line, this._AABBBounds, this),
|
|
15428
15481
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -15513,7 +15566,7 @@
|
|
|
15513
15566
|
key: "doUpdateAABBBounds",
|
|
15514
15567
|
value: function doUpdateAABBBounds() {
|
|
15515
15568
|
var rectTheme = getTheme(this).rect;
|
|
15516
|
-
this._AABBBounds.
|
|
15569
|
+
this._AABBBounds.clear();
|
|
15517
15570
|
var attribute = this.attribute,
|
|
15518
15571
|
bounds = application.graphicService.updateRectAABBBounds(attribute, getTheme(this).rect, this._AABBBounds, this),
|
|
15519
15572
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -15544,13 +15597,13 @@
|
|
|
15544
15597
|
}, {
|
|
15545
15598
|
key: "toCustomPath",
|
|
15546
15599
|
value: function toCustomPath() {
|
|
15547
|
-
var attribute = this.attribute
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15600
|
+
var attribute = this.attribute,
|
|
15601
|
+
_normalizeRectAttribu = normalizeRectAttributes(attribute),
|
|
15602
|
+
x = _normalizeRectAttribu.x,
|
|
15603
|
+
y = _normalizeRectAttribu.y,
|
|
15604
|
+
width = _normalizeRectAttribu.width,
|
|
15605
|
+
height = _normalizeRectAttribu.height,
|
|
15606
|
+
path = new CustomPath2D();
|
|
15554
15607
|
return path.moveTo(x, y), path.rect(x, y, width, height), path;
|
|
15555
15608
|
}
|
|
15556
15609
|
}, {
|
|
@@ -15743,7 +15796,7 @@
|
|
|
15743
15796
|
}, {
|
|
15744
15797
|
key: "doUpdateAABBBounds",
|
|
15745
15798
|
value: function doUpdateAABBBounds() {
|
|
15746
|
-
this._AABBBounds.
|
|
15799
|
+
this._AABBBounds.clear();
|
|
15747
15800
|
var bounds = application.graphicService.updateGlyphAABBBounds(this.attribute, getTheme(this).glyph, this._AABBBounds, this);
|
|
15748
15801
|
return this.clearUpdateBoundTag(), bounds;
|
|
15749
15802
|
}
|
|
@@ -15840,16 +15893,7 @@
|
|
|
15840
15893
|
deltaY = -height;
|
|
15841
15894
|
}
|
|
15842
15895
|
var deltaX = 0;
|
|
15843
|
-
|
|
15844
|
-
case "left":
|
|
15845
|
-
deltaX = 0;
|
|
15846
|
-
break;
|
|
15847
|
-
case "center":
|
|
15848
|
-
deltaX = -width / 2;
|
|
15849
|
-
break;
|
|
15850
|
-
case "right":
|
|
15851
|
-
deltaX = -width;
|
|
15852
|
-
}
|
|
15896
|
+
"right" === this.globalAlign || "end" === this.globalAlign ? deltaX = -width : "center" === this.globalAlign && (deltaX = -width / 2);
|
|
15853
15897
|
var frameHeight = this[this.directionKey.height];
|
|
15854
15898
|
this.singleLine && (frameHeight = this.lines[0].height + 1);
|
|
15855
15899
|
var lastLineTag = !1;
|
|
@@ -16002,9 +16046,9 @@
|
|
|
16002
16046
|
var direction = this.direction;
|
|
16003
16047
|
if (this.verticalEllipsis) text = "...", direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
16004
16048
|
if ("hide" === this.ellipsis) return;
|
|
16005
|
-
if ("add" === this.ellipsis) text += "...", "right"
|
|
16049
|
+
if ("add" === this.ellipsis) text += "...", "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
16006
16050
|
var index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
16007
|
-
if (text = text.slice(0, index), text += "...", "right" === textAlign) {
|
|
16051
|
+
if (text = text.slice(0, index), text += "...", "right" === textAlign || "end" === textAlign) {
|
|
16008
16052
|
var _measureTextCanvas3 = measureTextCanvas(this.text.slice(index), this.character),
|
|
16009
16053
|
width = _measureTextCanvas3.width;
|
|
16010
16054
|
"vertical" === direction || (left -= this.ellipsisWidth - width);
|
|
@@ -16115,11 +16159,21 @@
|
|
|
16115
16159
|
_this3.failCallback && _this3.failCallback();
|
|
16116
16160
|
});
|
|
16117
16161
|
}
|
|
16162
|
+
}, {
|
|
16163
|
+
key: "setAttributes",
|
|
16164
|
+
value: function setAttributes(params, forceUpdateTag, context) {
|
|
16165
|
+
return params.image && this.loadImage(params.image), _get(_getPrototypeOf(Image.prototype), "setAttributes", this).call(this, params, forceUpdateTag, context);
|
|
16166
|
+
}
|
|
16167
|
+
}, {
|
|
16168
|
+
key: "setAttribute",
|
|
16169
|
+
value: function setAttribute(key, value, forceUpdateTag, context) {
|
|
16170
|
+
return "image" === key && this.loadImage(value), _get(_getPrototypeOf(Image.prototype), "setAttribute", this).call(this, key, value, forceUpdateTag, context);
|
|
16171
|
+
}
|
|
16118
16172
|
}, {
|
|
16119
16173
|
key: "doUpdateAABBBounds",
|
|
16120
16174
|
value: function doUpdateAABBBounds() {
|
|
16121
16175
|
var imageTheme = getTheme(this).image;
|
|
16122
|
-
this._AABBBounds.
|
|
16176
|
+
this._AABBBounds.clear();
|
|
16123
16177
|
var attribute = this.attribute,
|
|
16124
16178
|
bounds = application.graphicService.updateImageAABBBounds(attribute, getTheme(this).image, this._AABBBounds, this),
|
|
16125
16179
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -16250,17 +16304,7 @@
|
|
|
16250
16304
|
maxHeight = this.height;
|
|
16251
16305
|
var x = this.left,
|
|
16252
16306
|
spacing = 0;
|
|
16253
|
-
|
|
16254
|
-
case "right":
|
|
16255
|
-
x = width - this.actualWidth;
|
|
16256
|
-
break;
|
|
16257
|
-
case "center":
|
|
16258
|
-
x = (width - this.actualWidth) / 2;
|
|
16259
|
-
break;
|
|
16260
|
-
case "justify":
|
|
16261
|
-
this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1);
|
|
16262
|
-
}
|
|
16263
|
-
this.paragraphs.map(function (paragraph) {
|
|
16307
|
+
this.actualWidth < width && !isWidthMax && ("right" === this.textAlign || "end" === this.textAlign ? x = width - this.actualWidth : "center" === this.textAlign ? x = (width - this.actualWidth) / 2 : "justify" === this.textAlign && (this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1))), this.paragraphs.map(function (paragraph) {
|
|
16264
16308
|
paragraph instanceof RichTextIcon ? (paragraph["_" + directionKey.x] = x, x += paragraph[directionKey.width] + spacing, paragraph["_" + directionKey.y] = "top" === paragraph.attribute.textBaseline ? 0 : "bottom" === paragraph.attribute.textBaseline ? maxHeight - paragraph.height : (maxHeight - paragraph.height) / 2) : (paragraph[directionKey.left] = x, x += paragraph[directionKey.width] + spacing);
|
|
16265
16309
|
});
|
|
16266
16310
|
}
|
|
@@ -16478,7 +16522,7 @@
|
|
|
16478
16522
|
key: "doUpdateAABBBounds",
|
|
16479
16523
|
value: function doUpdateAABBBounds() {
|
|
16480
16524
|
var richTextTheme = getTheme(this).richtext;
|
|
16481
|
-
this._AABBBounds.
|
|
16525
|
+
this._AABBBounds.clear();
|
|
16482
16526
|
var attribute = this.attribute,
|
|
16483
16527
|
bounds = application.graphicService.updateRichTextAABBBounds(attribute, getTheme(this).richtext, this._AABBBounds, this),
|
|
16484
16528
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -16511,28 +16555,47 @@
|
|
|
16511
16555
|
value: function getFrameCache() {
|
|
16512
16556
|
return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
|
|
16513
16557
|
}
|
|
16558
|
+
}, {
|
|
16559
|
+
key: "combinedStyleToCharacter",
|
|
16560
|
+
value: function combinedStyleToCharacter(config) {
|
|
16561
|
+
var _this$attribute = this.attribute,
|
|
16562
|
+
fill = _this$attribute.fill,
|
|
16563
|
+
stroke = _this$attribute.stroke,
|
|
16564
|
+
fontSize = _this$attribute.fontSize,
|
|
16565
|
+
fontFamily = _this$attribute.fontFamily,
|
|
16566
|
+
fontStyle = _this$attribute.fontStyle,
|
|
16567
|
+
fontWeight = _this$attribute.fontWeight;
|
|
16568
|
+
return Object.assign({
|
|
16569
|
+
fill: fill,
|
|
16570
|
+
stroke: stroke,
|
|
16571
|
+
fontSize: fontSize,
|
|
16572
|
+
fontFamily: fontFamily,
|
|
16573
|
+
fontStyle: fontStyle,
|
|
16574
|
+
fontWeight: fontWeight
|
|
16575
|
+
}, config);
|
|
16576
|
+
}
|
|
16514
16577
|
}, {
|
|
16515
16578
|
key: "doUpdateFrameCache",
|
|
16516
16579
|
value: function doUpdateFrameCache() {
|
|
16517
16580
|
var _this2 = this;
|
|
16518
16581
|
var _a;
|
|
16519
|
-
var _this$
|
|
16520
|
-
_this$
|
|
16521
|
-
textConfig = _this$
|
|
16522
|
-
maxWidth = _this$
|
|
16523
|
-
maxHeight = _this$
|
|
16524
|
-
width = _this$
|
|
16525
|
-
height = _this$
|
|
16526
|
-
ellipsis = _this$
|
|
16527
|
-
wordBreak = _this$
|
|
16528
|
-
verticalDirection = _this$
|
|
16529
|
-
textAlign = _this$
|
|
16530
|
-
textBaseline = _this$
|
|
16531
|
-
layoutDirection = _this$
|
|
16532
|
-
singleLine = _this$
|
|
16582
|
+
var _this$attribute2 = this.attribute,
|
|
16583
|
+
_this$attribute2$text = _this$attribute2.textConfig,
|
|
16584
|
+
textConfig = _this$attribute2$text === void 0 ? [] : _this$attribute2$text,
|
|
16585
|
+
maxWidth = _this$attribute2.maxWidth,
|
|
16586
|
+
maxHeight = _this$attribute2.maxHeight,
|
|
16587
|
+
width = _this$attribute2.width,
|
|
16588
|
+
height = _this$attribute2.height,
|
|
16589
|
+
ellipsis = _this$attribute2.ellipsis,
|
|
16590
|
+
wordBreak = _this$attribute2.wordBreak,
|
|
16591
|
+
verticalDirection = _this$attribute2.verticalDirection,
|
|
16592
|
+
textAlign = _this$attribute2.textAlign,
|
|
16593
|
+
textBaseline = _this$attribute2.textBaseline,
|
|
16594
|
+
layoutDirection = _this$attribute2.layoutDirection,
|
|
16595
|
+
singleLine = _this$attribute2.singleLine,
|
|
16533
16596
|
paragraphs = [];
|
|
16534
16597
|
for (var i = 0; i < textConfig.length; i++) if ("image" in textConfig[i]) {
|
|
16535
|
-
var config = textConfig[i],
|
|
16598
|
+
var config = this.combinedStyleToCharacter(textConfig[i]),
|
|
16536
16599
|
iconCache = config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);
|
|
16537
16600
|
if (iconCache) paragraphs.push(iconCache);else {
|
|
16538
16601
|
var icon = new RichTextIcon(config);
|
|
@@ -16541,10 +16604,13 @@
|
|
|
16541
16604
|
_this2.addUpdateBoundTag(), null === (_a = _this2.stage) || void 0 === _a || _a.renderNextFrame();
|
|
16542
16605
|
}, icon.richtextId = config.id, paragraphs.push(icon);
|
|
16543
16606
|
}
|
|
16544
|
-
} else
|
|
16545
|
-
var
|
|
16546
|
-
|
|
16547
|
-
|
|
16607
|
+
} else {
|
|
16608
|
+
var richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
16609
|
+
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
16610
|
+
var textParts = richTextConfig.text.split("\n");
|
|
16611
|
+
for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
16612
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
16613
|
+
}
|
|
16548
16614
|
var maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
16549
16615
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
16550
16616
|
richTextWidthEnable = "number" == typeof width && Number.isFinite(width) && width > 0 && (!maxWidthFinite || width <= maxWidth),
|
|
@@ -16663,7 +16729,7 @@
|
|
|
16663
16729
|
key: "doUpdateAABBBounds",
|
|
16664
16730
|
value: function doUpdateAABBBounds() {
|
|
16665
16731
|
var pathTheme = getTheme(this).path;
|
|
16666
|
-
this.doUpdatePathShape(), this._AABBBounds.
|
|
16732
|
+
this.doUpdatePathShape(), this._AABBBounds.clear();
|
|
16667
16733
|
var attribute = this.attribute,
|
|
16668
16734
|
bounds = application.graphicService.updatePathAABBBounds(attribute, getTheme(this).path, this._AABBBounds, this),
|
|
16669
16735
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -16751,7 +16817,7 @@
|
|
|
16751
16817
|
key: "doUpdateAABBBounds",
|
|
16752
16818
|
value: function doUpdateAABBBounds() {
|
|
16753
16819
|
var areaTheme = getTheme(this).area;
|
|
16754
|
-
this._AABBBounds.
|
|
16820
|
+
this._AABBBounds.clear();
|
|
16755
16821
|
var attribute = this.attribute,
|
|
16756
16822
|
bounds = application.graphicService.updateAreaAABBBounds(attribute, getTheme(this).area, this._AABBBounds, this),
|
|
16757
16823
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -16869,7 +16935,7 @@
|
|
|
16869
16935
|
innerRadius = _this$attribute2$inne === void 0 ? arcTheme.innerRadius : _this$attribute2$inne;
|
|
16870
16936
|
if (0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
16871
16937
|
var deltaRadius = Math.abs(outerRadius - innerRadius);
|
|
16872
|
-
return Math.min(isNumber$
|
|
16938
|
+
return Math.min(isNumber$1(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
16873
16939
|
}
|
|
16874
16940
|
}, {
|
|
16875
16941
|
key: "getParsedAngle",
|
|
@@ -16954,7 +17020,7 @@
|
|
|
16954
17020
|
key: "doUpdateAABBBounds",
|
|
16955
17021
|
value: function doUpdateAABBBounds(full) {
|
|
16956
17022
|
var arcTheme = getTheme(this).arc;
|
|
16957
|
-
this._AABBBounds.
|
|
17023
|
+
this._AABBBounds.clear();
|
|
16958
17024
|
var attribute = this.attribute,
|
|
16959
17025
|
bounds = application.graphicService.updateArcAABBBounds(attribute, getTheme(this).arc, this._AABBBounds, full, this),
|
|
16960
17026
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -17040,7 +17106,7 @@
|
|
|
17040
17106
|
key: "doUpdateAABBBounds",
|
|
17041
17107
|
value: function doUpdateAABBBounds() {
|
|
17042
17108
|
var polygonTheme = getTheme(this).arc;
|
|
17043
|
-
this._AABBBounds.
|
|
17109
|
+
this._AABBBounds.clear();
|
|
17044
17110
|
var attribute = this.attribute,
|
|
17045
17111
|
bounds = application.graphicService.updateArc3dAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
|
|
17046
17112
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -17088,7 +17154,7 @@
|
|
|
17088
17154
|
key: "doUpdateAABBBounds",
|
|
17089
17155
|
value: function doUpdateAABBBounds() {
|
|
17090
17156
|
var polygonTheme = getTheme(this).polygon;
|
|
17091
|
-
this._AABBBounds.
|
|
17157
|
+
this._AABBBounds.clear();
|
|
17092
17158
|
var attribute = this.attribute,
|
|
17093
17159
|
bounds = application.graphicService.updatePolygonAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
|
|
17094
17160
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -17161,7 +17227,7 @@
|
|
|
17161
17227
|
key: "doUpdateAABBBounds",
|
|
17162
17228
|
value: function doUpdateAABBBounds() {
|
|
17163
17229
|
var polygonTheme = getTheme(this).polygon;
|
|
17164
|
-
this._AABBBounds.
|
|
17230
|
+
this._AABBBounds.clear();
|
|
17165
17231
|
var attribute = this.attribute,
|
|
17166
17232
|
bounds = application.graphicService.updatePyramid3dAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
|
|
17167
17233
|
_attribute$boundsPadd = attribute.boundsPadding,
|
|
@@ -18121,35 +18187,37 @@
|
|
|
18121
18187
|
}, {
|
|
18122
18188
|
key: "transformAABBBounds",
|
|
18123
18189
|
value: function transformAABBBounds(attribute, aabbBounds, theme, miter, graphic) {
|
|
18124
|
-
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18190
|
+
if (!aabbBounds.empty()) {
|
|
18191
|
+
var _attribute$scaleX2 = attribute.scaleX,
|
|
18192
|
+
scaleX = _attribute$scaleX2 === void 0 ? theme.scaleX : _attribute$scaleX2,
|
|
18193
|
+
_attribute$scaleY2 = attribute.scaleY,
|
|
18194
|
+
scaleY = _attribute$scaleY2 === void 0 ? theme.scaleY : _attribute$scaleY2,
|
|
18195
|
+
_attribute$stroke = attribute.stroke,
|
|
18196
|
+
stroke = _attribute$stroke === void 0 ? theme.stroke : _attribute$stroke,
|
|
18197
|
+
_attribute$shadowBlur2 = attribute.shadowBlur,
|
|
18198
|
+
shadowBlur = _attribute$shadowBlur2 === void 0 ? theme.shadowBlur : _attribute$shadowBlur2,
|
|
18199
|
+
_attribute$lineWidth = attribute.lineWidth,
|
|
18200
|
+
lineWidth = _attribute$lineWidth === void 0 ? theme.lineWidth : _attribute$lineWidth,
|
|
18201
|
+
_attribute$pickStroke = attribute.pickStrokeBuffer,
|
|
18202
|
+
pickStrokeBuffer = _attribute$pickStroke === void 0 ? theme.pickStrokeBuffer : _attribute$pickStroke,
|
|
18203
|
+
_attribute$strokeBoun2 = attribute.strokeBoundsBuffer,
|
|
18204
|
+
strokeBoundsBuffer = _attribute$strokeBoun2 === void 0 ? theme.strokeBoundsBuffer : _attribute$strokeBoun2,
|
|
18205
|
+
tb1 = this.tempAABBBounds1,
|
|
18206
|
+
tb2 = this.tempAABBBounds2;
|
|
18207
|
+
if (stroke && lineWidth) {
|
|
18208
|
+
var scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);
|
|
18209
|
+
boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
18210
|
+
}
|
|
18211
|
+
if (shadowBlur) {
|
|
18212
|
+
var _attribute$shadowOffs = attribute.shadowOffsetX,
|
|
18213
|
+
shadowOffsetX = _attribute$shadowOffs === void 0 ? theme.shadowOffsetX : _attribute$shadowOffs,
|
|
18214
|
+
_attribute$shadowOffs2 = attribute.shadowOffsetY,
|
|
18215
|
+
shadowOffsetY = _attribute$shadowOffs2 === void 0 ? theme.shadowOffsetY : _attribute$shadowOffs2,
|
|
18216
|
+
shadowBlurWidth = shadowBlur / Math.abs(scaleX + scaleY) * 2;
|
|
18217
|
+
boundStroke(tb1, shadowBlurWidth, !1, strokeBoundsBuffer + 1), tb1.translate(shadowOffsetX, shadowOffsetY), aabbBounds.union(tb1);
|
|
18218
|
+
}
|
|
18143
18219
|
}
|
|
18144
|
-
if (
|
|
18145
|
-
var _attribute$shadowOffs = attribute.shadowOffsetX,
|
|
18146
|
-
shadowOffsetX = _attribute$shadowOffs === void 0 ? theme.shadowOffsetX : _attribute$shadowOffs,
|
|
18147
|
-
_attribute$shadowOffs2 = attribute.shadowOffsetY,
|
|
18148
|
-
shadowOffsetY = _attribute$shadowOffs2 === void 0 ? theme.shadowOffsetY : _attribute$shadowOffs2,
|
|
18149
|
-
shadowBlurWidth = shadowBlur / Math.abs(scaleX + scaleY) * 2;
|
|
18150
|
-
boundStroke(tb1, shadowBlurWidth, !1, strokeBoundsBuffer + 1), tb1.translate(shadowOffsetX, shadowOffsetY), aabbBounds.union(tb1);
|
|
18151
|
-
}
|
|
18152
|
-
this.combindShadowAABBBounds(aabbBounds, graphic);
|
|
18220
|
+
if (this.combindShadowAABBBounds(aabbBounds, graphic), aabbBounds.empty()) return;
|
|
18153
18221
|
var updateMatrix = !0;
|
|
18154
18222
|
var m = graphic.transMatrix;
|
|
18155
18223
|
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);
|
|
@@ -18191,7 +18259,7 @@
|
|
|
18191
18259
|
|
|
18192
18260
|
var text, richText;
|
|
18193
18261
|
function getTextBounds(params) {
|
|
18194
|
-
return text || (text = graphicCreator.CreateGraphic("text", {})), text.
|
|
18262
|
+
return text || (text = graphicCreator.CreateGraphic("text", {})), text.initAttributes(params), text.AABBBounds;
|
|
18195
18263
|
}
|
|
18196
18264
|
function getRichTextBounds(params) {
|
|
18197
18265
|
return richText || (richText = graphicCreator.CreateGraphic("richtext", {})), richText.setAttributes(params), richText.AABBBounds;
|
|
@@ -18364,6 +18432,254 @@
|
|
|
18364
18432
|
return BaseRender;
|
|
18365
18433
|
}();
|
|
18366
18434
|
|
|
18435
|
+
var parse = function () {
|
|
18436
|
+
var tokens = {
|
|
18437
|
+
linearGradient: /^(linear\-gradient)/i,
|
|
18438
|
+
radialGradient: /^(radial\-gradient)/i,
|
|
18439
|
+
conicGradient: /^(conic\-gradient)/i,
|
|
18440
|
+
sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,
|
|
18441
|
+
extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
|
|
18442
|
+
positionKeywords: /^(left|center|right|top|bottom)/i,
|
|
18443
|
+
pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
|
|
18444
|
+
percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
|
|
18445
|
+
emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
|
|
18446
|
+
angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
|
|
18447
|
+
fromAngleValue: /^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
|
|
18448
|
+
startCall: /^\(/,
|
|
18449
|
+
endCall: /^\)/,
|
|
18450
|
+
comma: /^,/,
|
|
18451
|
+
hexColor: /(^\#[0-9a-fA-F]+)/,
|
|
18452
|
+
literalColor: /^([a-zA-Z]+)/,
|
|
18453
|
+
rgbColor: /^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,
|
|
18454
|
+
rgbaColor: /^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,
|
|
18455
|
+
number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
|
|
18456
|
+
};
|
|
18457
|
+
var input = "";
|
|
18458
|
+
function error(msg) {
|
|
18459
|
+
var err = new Error(input + ": " + msg);
|
|
18460
|
+
throw err.source = input, err;
|
|
18461
|
+
}
|
|
18462
|
+
function getAST() {
|
|
18463
|
+
var ast = matchListing(matchDefinition);
|
|
18464
|
+
return input.length > 0 && error("Invalid input not EOF"), ast;
|
|
18465
|
+
}
|
|
18466
|
+
function matchDefinition() {
|
|
18467
|
+
return matchGradient("linear", tokens.linearGradient, matchLinearOrientation) || matchGradient("radial", tokens.radialGradient, matchListRadialOrientations) || matchGradient("conic", tokens.conicGradient, matchConicalOrientation);
|
|
18468
|
+
}
|
|
18469
|
+
function matchGradient(gradientType, pattern, orientationMatcher) {
|
|
18470
|
+
return function (pattern, callback) {
|
|
18471
|
+
var captures = scan(pattern);
|
|
18472
|
+
if (captures) {
|
|
18473
|
+
scan(tokens.startCall) || error("Missing (");
|
|
18474
|
+
var result = callback(captures);
|
|
18475
|
+
return scan(tokens.endCall) || error("Missing )"), result;
|
|
18476
|
+
}
|
|
18477
|
+
}(pattern, function (captures) {
|
|
18478
|
+
var orientation = orientationMatcher();
|
|
18479
|
+
return orientation && (scan(tokens.comma) || error("Missing comma before color stops")), {
|
|
18480
|
+
type: gradientType,
|
|
18481
|
+
orientation: orientation,
|
|
18482
|
+
colorStops: matchListing(matchColorStop)
|
|
18483
|
+
};
|
|
18484
|
+
});
|
|
18485
|
+
}
|
|
18486
|
+
function matchLinearOrientation() {
|
|
18487
|
+
return match("directional", tokens.sideOrCorner, 1) || match("angular", tokens.angleValue, 1);
|
|
18488
|
+
}
|
|
18489
|
+
function matchConicalOrientation() {
|
|
18490
|
+
return match("angular", tokens.fromAngleValue, 1);
|
|
18491
|
+
}
|
|
18492
|
+
function matchListRadialOrientations() {
|
|
18493
|
+
var radialOrientations,
|
|
18494
|
+
lookaheadCache,
|
|
18495
|
+
radialOrientation = matchRadialOrientation();
|
|
18496
|
+
return radialOrientation && (radialOrientations = [], radialOrientations.push(radialOrientation), lookaheadCache = input, scan(tokens.comma) && (radialOrientation = matchRadialOrientation(), radialOrientation ? radialOrientations.push(radialOrientation) : input = lookaheadCache)), radialOrientations;
|
|
18497
|
+
}
|
|
18498
|
+
function matchRadialOrientation() {
|
|
18499
|
+
var radialType = function () {
|
|
18500
|
+
var circle = match("shape", /^(circle)/i, 0);
|
|
18501
|
+
circle && (circle.style = matchLength() || matchExtentKeyword());
|
|
18502
|
+
return circle;
|
|
18503
|
+
}() || function () {
|
|
18504
|
+
var ellipse = match("shape", /^(ellipse)/i, 0);
|
|
18505
|
+
ellipse && (ellipse.style = matchDistance() || matchExtentKeyword());
|
|
18506
|
+
return ellipse;
|
|
18507
|
+
}();
|
|
18508
|
+
if (radialType) radialType.at = matchAtPosition();else {
|
|
18509
|
+
var extent = matchExtentKeyword();
|
|
18510
|
+
if (extent) {
|
|
18511
|
+
radialType = extent;
|
|
18512
|
+
var positionAt = matchAtPosition();
|
|
18513
|
+
positionAt && (radialType.at = positionAt);
|
|
18514
|
+
} else {
|
|
18515
|
+
var defaultPosition = matchPositioning();
|
|
18516
|
+
defaultPosition && (radialType = {
|
|
18517
|
+
type: "default-radial",
|
|
18518
|
+
at: defaultPosition
|
|
18519
|
+
});
|
|
18520
|
+
}
|
|
18521
|
+
}
|
|
18522
|
+
return radialType;
|
|
18523
|
+
}
|
|
18524
|
+
function matchExtentKeyword() {
|
|
18525
|
+
return match("extent-keyword", tokens.extentKeywords, 1);
|
|
18526
|
+
}
|
|
18527
|
+
function matchAtPosition() {
|
|
18528
|
+
if (match("position", /^at/, 0)) {
|
|
18529
|
+
var positioning = matchPositioning();
|
|
18530
|
+
return positioning || error("Missing positioning value"), positioning;
|
|
18531
|
+
}
|
|
18532
|
+
}
|
|
18533
|
+
function matchPositioning() {
|
|
18534
|
+
var location = {
|
|
18535
|
+
x: matchDistance(),
|
|
18536
|
+
y: matchDistance()
|
|
18537
|
+
};
|
|
18538
|
+
if (location.x || location.y) return {
|
|
18539
|
+
type: "position",
|
|
18540
|
+
value: location
|
|
18541
|
+
};
|
|
18542
|
+
}
|
|
18543
|
+
function matchListing(matcher) {
|
|
18544
|
+
var captures = matcher();
|
|
18545
|
+
var result = [];
|
|
18546
|
+
if (captures) for (result.push(captures); scan(tokens.comma);) captures = matcher(), captures ? result.push(captures) : error("One extra comma");
|
|
18547
|
+
return result;
|
|
18548
|
+
}
|
|
18549
|
+
function matchColorStop() {
|
|
18550
|
+
var color = match("hex", tokens.hexColor, 1) || match("rgba", tokens.rgbaColor, 1) || match("rgb", tokens.rgbColor, 1) || match("literal", tokens.literalColor, 0);
|
|
18551
|
+
return color || error("Expected color definition"), color.length = matchDistance(), color;
|
|
18552
|
+
}
|
|
18553
|
+
function matchDistance() {
|
|
18554
|
+
return match("%", tokens.percentageValue, 1) || match("position-keyword", tokens.positionKeywords, 1) || matchLength();
|
|
18555
|
+
}
|
|
18556
|
+
function matchLength() {
|
|
18557
|
+
return match("px", tokens.pixelValue, 1) || match("em", tokens.emValue, 1);
|
|
18558
|
+
}
|
|
18559
|
+
function match(type, pattern, captureIndex) {
|
|
18560
|
+
var captures = scan(pattern);
|
|
18561
|
+
if (captures) return {
|
|
18562
|
+
type: type,
|
|
18563
|
+
value: captures[captureIndex]
|
|
18564
|
+
};
|
|
18565
|
+
}
|
|
18566
|
+
function scan(regexp) {
|
|
18567
|
+
var blankCaptures = /^[\n\r\t\s]+/.exec(input);
|
|
18568
|
+
blankCaptures && consume(blankCaptures[0].length);
|
|
18569
|
+
var captures = regexp.exec(input);
|
|
18570
|
+
return captures && consume(captures[0].length), captures;
|
|
18571
|
+
}
|
|
18572
|
+
function consume(size) {
|
|
18573
|
+
input = input.substr(size);
|
|
18574
|
+
}
|
|
18575
|
+
return function (code) {
|
|
18576
|
+
return input = code.toString(), getAST();
|
|
18577
|
+
};
|
|
18578
|
+
}();
|
|
18579
|
+
var GradientParser = /*#__PURE__*/function () {
|
|
18580
|
+
function GradientParser() {
|
|
18581
|
+
_classCallCheck(this, GradientParser);
|
|
18582
|
+
}
|
|
18583
|
+
_createClass(GradientParser, null, [{
|
|
18584
|
+
key: "IsGradient",
|
|
18585
|
+
value: function IsGradient(c) {
|
|
18586
|
+
return !("string" == typeof c && c.length < 10);
|
|
18587
|
+
}
|
|
18588
|
+
}, {
|
|
18589
|
+
key: "IsGradientStr",
|
|
18590
|
+
value: function IsGradientStr(c) {
|
|
18591
|
+
return "string" == typeof c && c.length > 10;
|
|
18592
|
+
}
|
|
18593
|
+
}, {
|
|
18594
|
+
key: "Parse",
|
|
18595
|
+
value: function Parse(c) {
|
|
18596
|
+
if (GradientParser.IsGradientStr(c)) try {
|
|
18597
|
+
var datum = parse(c)[0];
|
|
18598
|
+
if (datum) {
|
|
18599
|
+
if ("linear" === datum.type) return GradientParser.ParseLinear(datum);
|
|
18600
|
+
if ("radial" === datum.type) return GradientParser.ParseRadial(datum);
|
|
18601
|
+
if ("conic" === datum.type) return GradientParser.ParseConic(datum);
|
|
18602
|
+
}
|
|
18603
|
+
} catch (err) {
|
|
18604
|
+
return c;
|
|
18605
|
+
}
|
|
18606
|
+
return c;
|
|
18607
|
+
}
|
|
18608
|
+
}, {
|
|
18609
|
+
key: "ParseConic",
|
|
18610
|
+
value: function ParseConic(datum) {
|
|
18611
|
+
var orientation = datum.orientation,
|
|
18612
|
+
_datum$colorStops = datum.colorStops,
|
|
18613
|
+
colorStops = _datum$colorStops === void 0 ? [] : _datum$colorStops,
|
|
18614
|
+
halfPi = pi / 2,
|
|
18615
|
+
sa = parseFloat(orientation.value) / 180 * pi - halfPi;
|
|
18616
|
+
return {
|
|
18617
|
+
gradient: "conical",
|
|
18618
|
+
x: .5,
|
|
18619
|
+
y: .5,
|
|
18620
|
+
startAngle: sa,
|
|
18621
|
+
endAngle: sa + pi2,
|
|
18622
|
+
stops: colorStops.map(function (item) {
|
|
18623
|
+
return {
|
|
18624
|
+
color: item.value,
|
|
18625
|
+
offset: parseFloat(item.length.value) / 100
|
|
18626
|
+
};
|
|
18627
|
+
})
|
|
18628
|
+
};
|
|
18629
|
+
}
|
|
18630
|
+
}, {
|
|
18631
|
+
key: "ParseRadial",
|
|
18632
|
+
value: function ParseRadial(datum) {
|
|
18633
|
+
var _datum$colorStops2 = datum.colorStops,
|
|
18634
|
+
colorStops = _datum$colorStops2 === void 0 ? [] : _datum$colorStops2;
|
|
18635
|
+
return {
|
|
18636
|
+
gradient: "radial",
|
|
18637
|
+
x0: .5,
|
|
18638
|
+
y0: .5,
|
|
18639
|
+
x1: .5,
|
|
18640
|
+
y1: .5,
|
|
18641
|
+
r0: 0,
|
|
18642
|
+
r1: 1,
|
|
18643
|
+
stops: colorStops.map(function (item) {
|
|
18644
|
+
return {
|
|
18645
|
+
color: item.value,
|
|
18646
|
+
offset: parseFloat(item.length.value) / 100
|
|
18647
|
+
};
|
|
18648
|
+
})
|
|
18649
|
+
};
|
|
18650
|
+
}
|
|
18651
|
+
}, {
|
|
18652
|
+
key: "ParseLinear",
|
|
18653
|
+
value: function ParseLinear(datum) {
|
|
18654
|
+
var orientation = datum.orientation,
|
|
18655
|
+
_datum$colorStops3 = datum.colorStops,
|
|
18656
|
+
colorStops = _datum$colorStops3 === void 0 ? [] : _datum$colorStops3,
|
|
18657
|
+
halfPi = pi / 2;
|
|
18658
|
+
var angle = "angular" === orientation.type ? parseFloat(orientation.value) / 180 * pi : 0;
|
|
18659
|
+
for (; angle < 0;) angle += pi2;
|
|
18660
|
+
for (; angle > pi2;) angle -= pi2;
|
|
18661
|
+
var x0 = 0,
|
|
18662
|
+
y0 = 0,
|
|
18663
|
+
x1 = 0,
|
|
18664
|
+
y1 = 0;
|
|
18665
|
+
return angle < halfPi ? (x0 = 0, y0 = 1, x1 = Math.sin(angle), y1 = Math.cos(angle)) : angle < pi ? (x0 = 0, y0 = 0, x1 = Math.cos(angle - halfPi), y1 = Math.sin(angle - halfPi)) : angle < pi + halfPi ? (x0 = 1, y0 = 0, x1 = x0 - Math.sin(angle - pi), y1 = Math.cos(angle - pi)) : (x0 = 1, x1 = x0 - Math.cos(angle - halfPi - pi), y1 -= Math.sin(angle - halfPi - pi)), {
|
|
18666
|
+
gradient: "linear",
|
|
18667
|
+
x0: x0,
|
|
18668
|
+
y0: y0,
|
|
18669
|
+
x1: x1,
|
|
18670
|
+
y1: y1,
|
|
18671
|
+
stops: colorStops.map(function (item) {
|
|
18672
|
+
return {
|
|
18673
|
+
color: item.value,
|
|
18674
|
+
offset: parseFloat(item.length.value) / 100
|
|
18675
|
+
};
|
|
18676
|
+
})
|
|
18677
|
+
};
|
|
18678
|
+
}
|
|
18679
|
+
}]);
|
|
18680
|
+
return GradientParser;
|
|
18681
|
+
}();
|
|
18682
|
+
|
|
18367
18683
|
function getScaledStroke(context, width, dpr) {
|
|
18368
18684
|
var strokeWidth = width;
|
|
18369
18685
|
var _context$currentMatri = context.currentMatrix,
|
|
@@ -18379,7 +18695,7 @@
|
|
|
18379
18695
|
if (!c || !0 === c) return "black";
|
|
18380
18696
|
var result, color;
|
|
18381
18697
|
if (isArray$1(c)) for (var i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
18382
|
-
return "string" == typeof color ? color : ("linear" === color.gradient ? result = createLinearGradient(context, color, params, offsetX, offsetY) : "conical" === color.gradient ? result = createConicGradient(context, color, params, offsetX, offsetY) : "radial" === color.gradient && (result = createRadialGradient(context, color, params, offsetX, offsetY)), result || "orange");
|
|
18698
|
+
return color = GradientParser.Parse(color), "string" == typeof color ? color : ("linear" === color.gradient ? result = createLinearGradient(context, color, params, offsetX, offsetY) : "conical" === color.gradient ? result = createConicGradient(context, color, params, offsetX, offsetY) : "radial" === color.gradient && (result = createRadialGradient(context, color, params, offsetX, offsetY)), result || "orange");
|
|
18383
18699
|
}
|
|
18384
18700
|
function createLinearGradient(context, color, params) {
|
|
18385
18701
|
var offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
@@ -18480,7 +18796,9 @@
|
|
|
18480
18796
|
var _graphic$attribute = graphic.attribute,
|
|
18481
18797
|
background = _graphic$attribute.background,
|
|
18482
18798
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
18483
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
18799
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
|
|
18800
|
+
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
18801
|
+
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
18484
18802
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
18485
18803
|
var res = graphic.resources.get(background);
|
|
18486
18804
|
if ("success" !== res.state || !res.data) return;
|
|
@@ -18495,15 +18813,37 @@
|
|
|
18495
18813
|
}
|
|
18496
18814
|
context.clip();
|
|
18497
18815
|
var b = graphic.AABBBounds;
|
|
18498
|
-
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18816
|
+
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18499
18817
|
} else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
18500
18818
|
}
|
|
18501
18819
|
}, {
|
|
18502
18820
|
key: "doDrawImage",
|
|
18503
|
-
value: function doDrawImage(context, data, b, backgroundMode) {
|
|
18821
|
+
value: function doDrawImage(context, data, b, backgroundMode, backgroundFit) {
|
|
18504
18822
|
if ("no-repeat" === backgroundMode) context.drawImage(data, b.x1, b.y1, b.width(), b.height());else {
|
|
18505
|
-
var
|
|
18506
|
-
|
|
18823
|
+
var targetW = b.width(),
|
|
18824
|
+
targetH = b.height();
|
|
18825
|
+
var w = targetW,
|
|
18826
|
+
h = targetH;
|
|
18827
|
+
if (backgroundFit && "repeat" !== backgroundMode && (data.width || data.height)) {
|
|
18828
|
+
var resW = data.width,
|
|
18829
|
+
resH = data.height;
|
|
18830
|
+
if ("repeat-x" === backgroundMode) {
|
|
18831
|
+
w = resW * (targetH / resH), h = targetH;
|
|
18832
|
+
} else if ("repeat-y" === backgroundMode) {
|
|
18833
|
+
h = resH * (targetW / resW), w = targetW;
|
|
18834
|
+
}
|
|
18835
|
+
var _dpr = context.dpr,
|
|
18836
|
+
canvas = canvasAllocate.allocate({
|
|
18837
|
+
width: w,
|
|
18838
|
+
height: h,
|
|
18839
|
+
dpr: _dpr
|
|
18840
|
+
}),
|
|
18841
|
+
ctx = canvas.getContext("2d");
|
|
18842
|
+
ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), canvasAllocate.free(canvas);
|
|
18843
|
+
}
|
|
18844
|
+
var dpr = context.dpr,
|
|
18845
|
+
pattern = context.createPattern(data, backgroundMode);
|
|
18846
|
+
pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, 0, 0])), context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
|
|
18507
18847
|
}
|
|
18508
18848
|
}
|
|
18509
18849
|
}]);
|
|
@@ -18526,6 +18866,7 @@
|
|
|
18526
18866
|
return DefaultBaseInteractiveRenderContribution;
|
|
18527
18867
|
}();
|
|
18528
18868
|
exports.DefaultBaseInteractiveRenderContribution = __decorate$1w([injectable(), __param$O(0, inject(ContributionProvider)), __param$O(0, named(InteractiveSubRenderContribution)), __metadata$19("design:paramtypes", [Object])], exports.DefaultBaseInteractiveRenderContribution);
|
|
18869
|
+
|
|
18529
18870
|
var DefaultBaseTextureRenderContribution = /*#__PURE__*/function () {
|
|
18530
18871
|
function DefaultBaseTextureRenderContribution() {
|
|
18531
18872
|
_classCallCheck(this, DefaultBaseTextureRenderContribution);
|
|
@@ -18626,16 +18967,20 @@
|
|
|
18626
18967
|
key: "drawShape",
|
|
18627
18968
|
value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
18628
18969
|
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
18629
|
-
var _graphic$
|
|
18630
|
-
_graphic$
|
|
18631
|
-
texture = _graphic$
|
|
18632
|
-
_graphic$
|
|
18633
|
-
textureColor = _graphic$
|
|
18634
|
-
_graphic$
|
|
18635
|
-
textureSize = _graphic$
|
|
18636
|
-
_graphic$
|
|
18637
|
-
texturePadding = _graphic$
|
|
18638
|
-
|
|
18970
|
+
var _graphic$attribute = graphic.attribute,
|
|
18971
|
+
_graphic$attribute$te = _graphic$attribute.texture,
|
|
18972
|
+
texture = _graphic$attribute$te === void 0 ? graphicAttribute.texture : _graphic$attribute$te,
|
|
18973
|
+
_graphic$attribute$te2 = _graphic$attribute.textureColor,
|
|
18974
|
+
textureColor = _graphic$attribute$te2 === void 0 ? graphicAttribute.textureColor : _graphic$attribute$te2,
|
|
18975
|
+
_graphic$attribute$te3 = _graphic$attribute.textureSize,
|
|
18976
|
+
textureSize = _graphic$attribute$te3 === void 0 ? graphicAttribute.textureSize : _graphic$attribute$te3,
|
|
18977
|
+
_graphic$attribute$te4 = _graphic$attribute.texturePadding,
|
|
18978
|
+
texturePadding = _graphic$attribute$te4 === void 0 ? graphicAttribute.texturePadding : _graphic$attribute$te4;
|
|
18979
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
18980
|
+
}
|
|
18981
|
+
}, {
|
|
18982
|
+
key: "drawTexture",
|
|
18983
|
+
value: function drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
18639
18984
|
var pattern = this.textureMap.get(texture);
|
|
18640
18985
|
if (!pattern) switch (texture) {
|
|
18641
18986
|
case "circle":
|
|
@@ -18822,13 +19167,15 @@
|
|
|
18822
19167
|
var _graphic$attribute = graphic.attribute,
|
|
18823
19168
|
background = _graphic$attribute.background,
|
|
18824
19169
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
18825
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
19170
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
|
|
19171
|
+
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
19172
|
+
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
18826
19173
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
18827
19174
|
var res = graphic.resources.get(background);
|
|
18828
19175
|
if ("success" !== res.state || !res.data) return;
|
|
18829
19176
|
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
|
|
18830
19177
|
var b = graphic.AABBBounds;
|
|
18831
|
-
this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
19178
|
+
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
18832
19179
|
} else context.highPerformanceSave(), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
18833
19180
|
}
|
|
18834
19181
|
}]);
|
|
@@ -18839,7 +19186,7 @@
|
|
|
18839
19186
|
var halfPi = pi / 2;
|
|
18840
19187
|
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
18841
19188
|
var cornerRadius;
|
|
18842
|
-
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
19189
|
+
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
18843
19190
|
var cornerRadiusArr = rectCornerRadius;
|
|
18844
19191
|
var cr0, cr1;
|
|
18845
19192
|
switch (cornerRadiusArr.length) {
|
|
@@ -18910,7 +19257,9 @@
|
|
|
18910
19257
|
var _graphic$attribute = graphic.attribute,
|
|
18911
19258
|
background = _graphic$attribute.background,
|
|
18912
19259
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
18913
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
19260
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
|
|
19261
|
+
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
19262
|
+
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
18914
19263
|
if (background) if (graphic.backgroundImg) {
|
|
18915
19264
|
var res = graphic.resources.get(background);
|
|
18916
19265
|
if ("success" !== res.state || !res.data) return;
|
|
@@ -18924,7 +19273,7 @@
|
|
|
18924
19273
|
context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
|
|
18925
19274
|
}
|
|
18926
19275
|
var b = graphic.AABBBounds;
|
|
18927
|
-
this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
19276
|
+
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18928
19277
|
} else if (isObject$1(background)) {
|
|
18929
19278
|
var stroke = background.stroke,
|
|
18930
19279
|
fill = background.fill,
|
|
@@ -18960,7 +19309,7 @@
|
|
|
18960
19309
|
y = bounds.y1,
|
|
18961
19310
|
width = bounds.width(),
|
|
18962
19311
|
height = bounds.height();
|
|
18963
|
-
return isNumber$
|
|
19312
|
+
return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
|
|
18964
19313
|
x: x,
|
|
18965
19314
|
y: y,
|
|
18966
19315
|
width: width,
|
|
@@ -19151,6 +19500,37 @@
|
|
|
19151
19500
|
var defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;
|
|
19152
19501
|
var defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
19153
19502
|
|
|
19503
|
+
var DefaultAreaTextureRenderContribution = /*#__PURE__*/function (_DefaultBaseTextureRe) {
|
|
19504
|
+
_inherits(DefaultAreaTextureRenderContribution, _DefaultBaseTextureRe);
|
|
19505
|
+
var _super = _createSuper(DefaultAreaTextureRenderContribution);
|
|
19506
|
+
function DefaultAreaTextureRenderContribution() {
|
|
19507
|
+
var _this;
|
|
19508
|
+
_classCallCheck(this, DefaultAreaTextureRenderContribution);
|
|
19509
|
+
_this = _super.apply(this, arguments), _this.time = exports.BaseRenderContributionTime.afterFillStroke;
|
|
19510
|
+
return _this;
|
|
19511
|
+
}
|
|
19512
|
+
_createClass(DefaultAreaTextureRenderContribution, [{
|
|
19513
|
+
key: "drawShape",
|
|
19514
|
+
value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
19515
|
+
var _a, _b, _c, _d;
|
|
19516
|
+
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
19517
|
+
var _ref = options || {},
|
|
19518
|
+
_ref$attribute = _ref.attribute,
|
|
19519
|
+
attribute = _ref$attribute === void 0 ? graphic.attribute : _ref$attribute,
|
|
19520
|
+
_attribute$texture = attribute.texture,
|
|
19521
|
+
texture = _attribute$texture === void 0 ? null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture") : _attribute$texture,
|
|
19522
|
+
_attribute$textureCol = attribute.textureColor,
|
|
19523
|
+
textureColor = _attribute$textureCol === void 0 ? null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor") : _attribute$textureCol,
|
|
19524
|
+
_attribute$textureSiz = attribute.textureSize,
|
|
19525
|
+
textureSize = _attribute$textureSiz === void 0 ? null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize") : _attribute$textureSiz,
|
|
19526
|
+
_attribute$texturePad = attribute.texturePadding,
|
|
19527
|
+
texturePadding = _attribute$texturePad === void 0 ? null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding") : _attribute$texturePad;
|
|
19528
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
19529
|
+
}
|
|
19530
|
+
}]);
|
|
19531
|
+
return DefaultAreaTextureRenderContribution;
|
|
19532
|
+
}(DefaultBaseTextureRenderContribution);
|
|
19533
|
+
|
|
19154
19534
|
var __decorate$1u = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19155
19535
|
var d,
|
|
19156
19536
|
c = arguments.length,
|
|
@@ -19391,6 +19771,26 @@
|
|
|
19391
19771
|
}(BaseRender);
|
|
19392
19772
|
exports.DefaultCanvasCircleRender = __decorate$1t([injectable(), __param$M(0, inject(ContributionProvider)), __param$M(0, named(CircleRenderContribution)), __metadata$17("design:paramtypes", [Object])], exports.DefaultCanvasCircleRender);
|
|
19393
19773
|
|
|
19774
|
+
function drawSegItem(ctx, curve, endPercent, params) {
|
|
19775
|
+
if (!curve.p1) return;
|
|
19776
|
+
var _ref = params || {},
|
|
19777
|
+
_ref$offsetX = _ref.offsetX,
|
|
19778
|
+
offsetX = _ref$offsetX === void 0 ? 0 : _ref$offsetX,
|
|
19779
|
+
_ref$offsetY = _ref.offsetY,
|
|
19780
|
+
offsetY = _ref$offsetY === void 0 ? 0 : _ref$offsetY,
|
|
19781
|
+
_ref$offsetZ = _ref.offsetZ,
|
|
19782
|
+
offsetZ = _ref$offsetZ === void 0 ? 0 : _ref$offsetZ;
|
|
19783
|
+
if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
|
|
19784
|
+
var _divideCubic = divideCubic(curve, endPercent),
|
|
19785
|
+
_divideCubic2 = _slicedToArray(_divideCubic, 1),
|
|
19786
|
+
curve1 = _divideCubic2[0];
|
|
19787
|
+
ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
|
|
19788
|
+
} else {
|
|
19789
|
+
var p = curve.getPointAt(endPercent);
|
|
19790
|
+
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
19791
|
+
}
|
|
19792
|
+
}
|
|
19793
|
+
|
|
19394
19794
|
function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
|
|
19395
19795
|
var _a;
|
|
19396
19796
|
var _ref = params || {},
|
|
@@ -19433,7 +19833,7 @@
|
|
|
19433
19833
|
} else _lastCurve = curve;
|
|
19434
19834
|
});
|
|
19435
19835
|
} else curves.forEach(function (curve) {
|
|
19436
|
-
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem
|
|
19836
|
+
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
|
|
19437
19837
|
});
|
|
19438
19838
|
return;
|
|
19439
19839
|
}
|
|
@@ -19472,7 +19872,7 @@
|
|
|
19472
19872
|
needMoveTo = !0;
|
|
19473
19873
|
continue;
|
|
19474
19874
|
}
|
|
19475
|
-
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem
|
|
19875
|
+
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, min(_p, 1), params), needMoveTo = !1;
|
|
19476
19876
|
}
|
|
19477
19877
|
}
|
|
19478
19878
|
}
|
|
@@ -19509,25 +19909,6 @@
|
|
|
19509
19909
|
path.lineTo(null !== (_c = startP.x1) && void 0 !== _c ? _c : startP.x, null !== (_d = startP.y1) && void 0 !== _d ? _d : startP.y), path.closePath();
|
|
19510
19910
|
});
|
|
19511
19911
|
}
|
|
19512
|
-
function drawSegItem$1(ctx, curve, endPercent, params) {
|
|
19513
|
-
if (!curve.p1) return;
|
|
19514
|
-
var _ref4 = params || {},
|
|
19515
|
-
_ref4$offsetX = _ref4.offsetX,
|
|
19516
|
-
offsetX = _ref4$offsetX === void 0 ? 0 : _ref4$offsetX,
|
|
19517
|
-
_ref4$offsetY = _ref4.offsetY,
|
|
19518
|
-
offsetY = _ref4$offsetY === void 0 ? 0 : _ref4$offsetY,
|
|
19519
|
-
_ref4$offsetZ = _ref4.offsetZ,
|
|
19520
|
-
offsetZ = _ref4$offsetZ === void 0 ? 0 : _ref4$offsetZ;
|
|
19521
|
-
if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
|
|
19522
|
-
var _divideCubic = divideCubic(curve, endPercent),
|
|
19523
|
-
_divideCubic2 = _slicedToArray(_divideCubic, 1),
|
|
19524
|
-
curve1 = _divideCubic2[0];
|
|
19525
|
-
ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
|
|
19526
|
-
} else {
|
|
19527
|
-
var p = curve.getPointAt(endPercent);
|
|
19528
|
-
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
19529
|
-
}
|
|
19530
|
-
}
|
|
19531
19912
|
|
|
19532
19913
|
var __decorate$1s = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19533
19914
|
var d,
|
|
@@ -19835,83 +20216,7 @@
|
|
|
19835
20216
|
}
|
|
19836
20217
|
path.closePath();
|
|
19837
20218
|
}
|
|
19838
|
-
function drawSegItem(ctx, curve, endPercent, params) {
|
|
19839
|
-
if (!curve.p1) return;
|
|
19840
|
-
var _ref5 = params || {},
|
|
19841
|
-
_ref5$offsetX = _ref5.offsetX,
|
|
19842
|
-
offsetX = _ref5$offsetX === void 0 ? 0 : _ref5$offsetX,
|
|
19843
|
-
_ref5$offsetY = _ref5.offsetY,
|
|
19844
|
-
offsetY = _ref5$offsetY === void 0 ? 0 : _ref5$offsetY,
|
|
19845
|
-
_ref5$offsetZ = _ref5.offsetZ,
|
|
19846
|
-
offsetZ = _ref5$offsetZ === void 0 ? 0 : _ref5$offsetZ;
|
|
19847
|
-
if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
|
|
19848
|
-
var _divideCubic = divideCubic(curve, endPercent),
|
|
19849
|
-
_divideCubic2 = _slicedToArray(_divideCubic, 1),
|
|
19850
|
-
curve1 = _divideCubic2[0];
|
|
19851
|
-
ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
|
|
19852
|
-
} else {
|
|
19853
|
-
var p = curve.getPointAt(endPercent);
|
|
19854
|
-
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
19855
|
-
}
|
|
19856
|
-
}
|
|
19857
20219
|
|
|
19858
|
-
var DefaultAreaTextureRenderContribution = /*#__PURE__*/function (_DefaultBaseTextureRe) {
|
|
19859
|
-
_inherits(DefaultAreaTextureRenderContribution, _DefaultBaseTextureRe);
|
|
19860
|
-
var _super = _createSuper(DefaultAreaTextureRenderContribution);
|
|
19861
|
-
function DefaultAreaTextureRenderContribution() {
|
|
19862
|
-
var _this;
|
|
19863
|
-
_classCallCheck(this, DefaultAreaTextureRenderContribution);
|
|
19864
|
-
_this = _super.apply(this, arguments), _this.time = exports.BaseRenderContributionTime.afterFillStroke;
|
|
19865
|
-
return _this;
|
|
19866
|
-
}
|
|
19867
|
-
_createClass(DefaultAreaTextureRenderContribution, [{
|
|
19868
|
-
key: "drawShape",
|
|
19869
|
-
value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
19870
|
-
var _a, _b, _c, _d;
|
|
19871
|
-
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
19872
|
-
var _ref = options || {},
|
|
19873
|
-
_ref$attribute = _ref.attribute,
|
|
19874
|
-
attribute = _ref$attribute === void 0 ? graphic.attribute : _ref$attribute,
|
|
19875
|
-
_attribute$texture = attribute.texture,
|
|
19876
|
-
texture = _attribute$texture === void 0 ? null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture") : _attribute$texture,
|
|
19877
|
-
_attribute$textureCol = attribute.textureColor,
|
|
19878
|
-
textureColor = _attribute$textureCol === void 0 ? null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor") : _attribute$textureCol,
|
|
19879
|
-
_attribute$textureSiz = attribute.textureSize,
|
|
19880
|
-
textureSize = _attribute$textureSiz === void 0 ? null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize") : _attribute$textureSiz,
|
|
19881
|
-
_attribute$texturePad = attribute.texturePadding,
|
|
19882
|
-
texturePadding = _attribute$texturePad === void 0 ? null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding") : _attribute$texturePad;
|
|
19883
|
-
if (!texture) return;
|
|
19884
|
-
var pattern = this.textureMap.get(texture);
|
|
19885
|
-
if (!pattern) switch (texture) {
|
|
19886
|
-
case "circle":
|
|
19887
|
-
pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
|
|
19888
|
-
break;
|
|
19889
|
-
case "diamond":
|
|
19890
|
-
pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
|
|
19891
|
-
break;
|
|
19892
|
-
case "rect":
|
|
19893
|
-
pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
|
|
19894
|
-
break;
|
|
19895
|
-
case "vertical-line":
|
|
19896
|
-
pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19897
|
-
break;
|
|
19898
|
-
case "horizontal-line":
|
|
19899
|
-
pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19900
|
-
break;
|
|
19901
|
-
case "bias-lr":
|
|
19902
|
-
pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19903
|
-
break;
|
|
19904
|
-
case "bias-rl":
|
|
19905
|
-
pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19906
|
-
break;
|
|
19907
|
-
case "grid":
|
|
19908
|
-
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
19909
|
-
}
|
|
19910
|
-
pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
|
|
19911
|
-
}
|
|
19912
|
-
}]);
|
|
19913
|
-
return DefaultAreaTextureRenderContribution;
|
|
19914
|
-
}(DefaultBaseTextureRenderContribution);
|
|
19915
20220
|
var defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();
|
|
19916
20221
|
var defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
19917
20222
|
|
|
@@ -19964,9 +20269,10 @@
|
|
|
19964
20269
|
key: "drawLinearAreaHighPerformance",
|
|
19965
20270
|
value: function drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
19966
20271
|
var _a, _b, _c, _d, _e;
|
|
20272
|
+
var points = area.attribute.points;
|
|
20273
|
+
if (points.length < 2) return;
|
|
19967
20274
|
context.beginPath();
|
|
19968
20275
|
var z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
|
|
19969
|
-
points = area.attribute.points,
|
|
19970
20276
|
startP = points[0];
|
|
19971
20277
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
19972
20278
|
for (var i = 1; i < points.length; i++) {
|
|
@@ -19985,7 +20291,9 @@
|
|
|
19985
20291
|
originX = _area$attribute$x === void 0 ? 0 : _area$attribute$x,
|
|
19986
20292
|
_area$attribute$x2 = _area$attribute.x,
|
|
19987
20293
|
originY = _area$attribute$x2 === void 0 ? 0 : _area$attribute$x2;
|
|
19988
|
-
if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())),
|
|
20294
|
+
if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
20295
|
+
attribute: area.attribute
|
|
20296
|
+
}), stroke) {
|
|
19989
20297
|
var _area$attribute$strok = area.attribute.stroke,
|
|
19990
20298
|
_stroke = _area$attribute$strok === void 0 ? areaAttribute && areaAttribute.stroke : _area$attribute$strok;
|
|
19991
20299
|
if (isArray$1(_stroke) && (_stroke[0] || _stroke[2]) && !1 === _stroke[1]) if (context.beginPath(), _stroke[0]) {
|
|
@@ -20002,9 +20310,7 @@
|
|
|
20002
20310
|
context.lineTo((null !== (_d = _p3.x1) && void 0 !== _d ? _d : _p3.x) + offsetX, (null !== (_e = _p3.y1) && void 0 !== _e ? _e : _p3.y) + offsetY, z);
|
|
20003
20311
|
}
|
|
20004
20312
|
}
|
|
20005
|
-
context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke()
|
|
20006
|
-
attribute: area.attribute
|
|
20007
|
-
});
|
|
20313
|
+
strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
|
|
20008
20314
|
}
|
|
20009
20315
|
}
|
|
20010
20316
|
}, {
|
|
@@ -20143,6 +20449,7 @@
|
|
|
20143
20449
|
key: "_drawSegmentItem",
|
|
20144
20450
|
value: function _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
|
|
20145
20451
|
var _a, _b, _c, _d;
|
|
20452
|
+
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
20146
20453
|
var connectedType = attribute.connectedType,
|
|
20147
20454
|
connectedX = attribute.connectedX,
|
|
20148
20455
|
connectedY = attribute.connectedY,
|
|
@@ -20151,7 +20458,6 @@
|
|
|
20151
20458
|
if (connect && (isArray$1(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$1(defaultAttribute) ? defaultAttribute.forEach(function (i) {
|
|
20152
20459
|
return da.push(i);
|
|
20153
20460
|
}) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
20154
|
-
if (!cache) return;
|
|
20155
20461
|
context.beginPath();
|
|
20156
20462
|
var _area$attribute4 = area.attribute,
|
|
20157
20463
|
points = _area$attribute4.points,
|
|
@@ -20429,6 +20735,46 @@
|
|
|
20429
20735
|
}(BaseRender);
|
|
20430
20736
|
exports.DefaultCanvasSymbolRender = __decorate$1o([injectable(), __param$I(0, inject(ContributionProvider)), __param$I(0, named(SymbolRenderContribution)), __metadata$13("design:paramtypes", [Object])], exports.DefaultCanvasSymbolRender);
|
|
20431
20737
|
|
|
20738
|
+
var DefaultBoundsAllocate = /*#__PURE__*/function () {
|
|
20739
|
+
function DefaultBoundsAllocate() {
|
|
20740
|
+
_classCallCheck(this, DefaultBoundsAllocate);
|
|
20741
|
+
this.pools = [];
|
|
20742
|
+
for (var i = 0; i < 10; i++) this.pools.push(new AABBBounds());
|
|
20743
|
+
}
|
|
20744
|
+
_createClass(DefaultBoundsAllocate, [{
|
|
20745
|
+
key: "allocate",
|
|
20746
|
+
value: function allocate(x1, y1, x2, y2) {
|
|
20747
|
+
if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
|
|
20748
|
+
var b = this.pools.pop();
|
|
20749
|
+
return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
|
|
20750
|
+
}
|
|
20751
|
+
}, {
|
|
20752
|
+
key: "allocateByObj",
|
|
20753
|
+
value: function allocateByObj(b) {
|
|
20754
|
+
if (!this.pools.length) return new AABBBounds(b);
|
|
20755
|
+
var _b = this.pools.pop();
|
|
20756
|
+
return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
|
|
20757
|
+
}
|
|
20758
|
+
}, {
|
|
20759
|
+
key: "free",
|
|
20760
|
+
value: function free(b) {
|
|
20761
|
+
this.pools.push(b);
|
|
20762
|
+
}
|
|
20763
|
+
}, {
|
|
20764
|
+
key: "length",
|
|
20765
|
+
get: function get() {
|
|
20766
|
+
return this.pools.length;
|
|
20767
|
+
}
|
|
20768
|
+
}, {
|
|
20769
|
+
key: "release",
|
|
20770
|
+
value: function release() {
|
|
20771
|
+
this.pools = [];
|
|
20772
|
+
}
|
|
20773
|
+
}]);
|
|
20774
|
+
return DefaultBoundsAllocate;
|
|
20775
|
+
}();
|
|
20776
|
+
var boundsAllocate = new DefaultBoundsAllocate();
|
|
20777
|
+
|
|
20432
20778
|
var DefaultTextBackgroundRenderContribution = /*#__PURE__*/function (_DefaultBaseBackgroun) {
|
|
20433
20779
|
_inherits(DefaultTextBackgroundRenderContribution, _DefaultBaseBackgroun);
|
|
20434
20780
|
var _super = _createSuper(DefaultTextBackgroundRenderContribution);
|
|
@@ -20441,17 +20787,38 @@
|
|
|
20441
20787
|
_createClass(DefaultTextBackgroundRenderContribution, [{
|
|
20442
20788
|
key: "drawShape",
|
|
20443
20789
|
value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
20790
|
+
var _a, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
20444
20791
|
var _graphic$attribute = graphic.attribute,
|
|
20445
|
-
background = _graphic$attribute.background,
|
|
20446
20792
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
20447
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
20793
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
|
|
20794
|
+
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
20795
|
+
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
20796
|
+
var b,
|
|
20797
|
+
background = graphic.attribute.background;
|
|
20448
20798
|
if (!background) return;
|
|
20449
|
-
var
|
|
20799
|
+
var shouldReCalBounds = isObject$1(background) && background.background,
|
|
20800
|
+
onlyTranslate = graphic.transMatrix.onlyTranslate();
|
|
20801
|
+
if (shouldReCalBounds) {
|
|
20802
|
+
var _b = graphic.AABBBounds,
|
|
20803
|
+
_x = (null !== (_a = background.x) && void 0 !== _a ? _a : _b.x1) + (null !== (_c = background.dx) && void 0 !== _c ? _c : 0),
|
|
20804
|
+
_y = (null !== (_d = background.y) && void 0 !== _d ? _d : _b.y1) + (null !== (_e = background.dy) && void 0 !== _e ? _e : 0),
|
|
20805
|
+
w = null !== (_f = background.width) && void 0 !== _f ? _f : _b.width(),
|
|
20806
|
+
h = null !== (_g = background.height) && void 0 !== _g ? _g : _b.height();
|
|
20807
|
+
if (b = boundsAllocate.allocate(_x, _y, _x + w, _y + h), background = background.background, !onlyTranslate) {
|
|
20808
|
+
var _w = b.width(),
|
|
20809
|
+
_h2 = b.height();
|
|
20810
|
+
b.set((null !== (_h = background.x) && void 0 !== _h ? _h : 0) + (null !== (_j = background.dx) && void 0 !== _j ? _j : 0), (null !== (_k = background.y) && void 0 !== _k ? _k : 0) + (null !== (_l = background.dy) && void 0 !== _l ? _l : 0), _w, _h2);
|
|
20811
|
+
}
|
|
20812
|
+
} else b = graphic.AABBBounds, onlyTranslate || b.set(0, 0, b.width(), b.height());
|
|
20450
20813
|
if (graphic.backgroundImg && graphic.resources) {
|
|
20451
20814
|
var res = graphic.resources.get(background);
|
|
20452
20815
|
if ("success" !== res.state || !res.data) return;
|
|
20453
|
-
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
20454
|
-
} else
|
|
20816
|
+
context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
20817
|
+
} else {
|
|
20818
|
+
var backgroundCornerRadius = graphic.attribute.backgroundCornerRadius;
|
|
20819
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
20820
|
+
}
|
|
20821
|
+
shouldReCalBounds && boundsAllocate.free(b);
|
|
20455
20822
|
}
|
|
20456
20823
|
}]);
|
|
20457
20824
|
return DefaultTextBackgroundRenderContribution;
|
|
@@ -20885,7 +21252,9 @@
|
|
|
20885
21252
|
value: function draw(image, renderService, drawContext) {
|
|
20886
21253
|
var url = image.attribute.image;
|
|
20887
21254
|
if (!url || !image.resources) return;
|
|
20888
|
-
|
|
21255
|
+
var res = image.resources.get(url);
|
|
21256
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
21257
|
+
if ("success" !== res.state) return;
|
|
20889
21258
|
var context = renderService.drawParams.context;
|
|
20890
21259
|
if (!context) return;
|
|
20891
21260
|
var imageAttribute = getTheme(image).image;
|
|
@@ -20926,156 +21295,169 @@
|
|
|
20926
21295
|
},
|
|
20927
21296
|
__metadata$$ = undefined && undefined.__metadata || function (k, v) {
|
|
20928
21297
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
20929
|
-
},
|
|
20930
|
-
__param$E = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
20931
|
-
return function (target, key) {
|
|
20932
|
-
decorator(target, key, paramIndex);
|
|
20933
|
-
};
|
|
20934
21298
|
};
|
|
20935
|
-
var
|
|
20936
|
-
var
|
|
20937
|
-
|
|
20938
|
-
function
|
|
20939
|
-
_classCallCheck(this,
|
|
20940
|
-
this.
|
|
21299
|
+
var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
|
|
21300
|
+
var tempDirtyBounds = new AABBBounds();
|
|
21301
|
+
var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21302
|
+
function ShadowRootDrawItemInterceptorContribution() {
|
|
21303
|
+
_classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
|
|
21304
|
+
this.order = 1;
|
|
20941
21305
|
}
|
|
20942
|
-
_createClass(
|
|
20943
|
-
key: "
|
|
20944
|
-
value: function
|
|
20945
|
-
|
|
20946
|
-
updateBounds && this.renderTreeRoots.forEach(function (g) {
|
|
20947
|
-
_this._prepare(g, updateBounds);
|
|
20948
|
-
});
|
|
20949
|
-
}
|
|
20950
|
-
}, {
|
|
20951
|
-
key: "_prepare",
|
|
20952
|
-
value: function _prepare(g, updateBounds) {
|
|
20953
|
-
var _this2 = this;
|
|
20954
|
-
g.forEachChildren(function (g) {
|
|
20955
|
-
_this2._prepare(g, updateBounds);
|
|
20956
|
-
}), g.update({
|
|
20957
|
-
bounds: updateBounds,
|
|
20958
|
-
trans: !0
|
|
20959
|
-
});
|
|
20960
|
-
}
|
|
20961
|
-
}, {
|
|
20962
|
-
key: "prepareRenderList",
|
|
20963
|
-
value: function prepareRenderList() {}
|
|
20964
|
-
}, {
|
|
20965
|
-
key: "beforeDraw",
|
|
20966
|
-
value: function beforeDraw(params) {}
|
|
20967
|
-
}, {
|
|
20968
|
-
key: "draw",
|
|
20969
|
-
value: function draw(params) {
|
|
20970
|
-
this.drawContribution.draw(this, Object.assign({}, this.drawParams));
|
|
21306
|
+
_createClass(ShadowRootDrawItemInterceptorContribution, [{
|
|
21307
|
+
key: "afterDrawItem",
|
|
21308
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21309
|
+
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
20971
21310
|
}
|
|
20972
21311
|
}, {
|
|
20973
|
-
key: "
|
|
20974
|
-
value: function
|
|
20975
|
-
|
|
21312
|
+
key: "beforeDrawItem",
|
|
21313
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21314
|
+
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
20976
21315
|
}
|
|
20977
21316
|
}, {
|
|
20978
|
-
key: "
|
|
20979
|
-
value: function
|
|
20980
|
-
|
|
20981
|
-
var
|
|
20982
|
-
|
|
21317
|
+
key: "drawItem",
|
|
21318
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21319
|
+
if (!graphic.shadowRoot) return !1;
|
|
21320
|
+
var context = drawContext.context;
|
|
21321
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21322
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21323
|
+
var m = graphic.globalTransMatrix.getInverse();
|
|
21324
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21325
|
+
}
|
|
21326
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
20983
21327
|
}
|
|
20984
21328
|
}]);
|
|
20985
|
-
return
|
|
21329
|
+
return ShadowRootDrawItemInterceptorContribution;
|
|
20986
21330
|
}();
|
|
20987
|
-
|
|
20988
|
-
|
|
20989
|
-
|
|
20990
|
-
bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
|
|
20991
|
-
});
|
|
20992
|
-
|
|
20993
|
-
var GraphicPicker = Symbol["for"]("GraphicPicker");
|
|
20994
|
-
var PickerService = Symbol["for"]("PickerService");
|
|
20995
|
-
var BoundsPicker = Symbol["for"]("BoundsPicker");
|
|
20996
|
-
var GlobalPickerService = Symbol["for"]("GlobalPickerService");
|
|
20997
|
-
|
|
20998
|
-
var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
20999
|
-
var d,
|
|
21000
|
-
c = arguments.length,
|
|
21001
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21002
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21003
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21004
|
-
};
|
|
21005
|
-
var PickItemInterceptor = Symbol["for"]("PickItemInterceptor");
|
|
21006
|
-
exports.ShadowRootPickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21007
|
-
function ShadowRootPickItemInterceptorContribution() {
|
|
21008
|
-
_classCallCheck(this, ShadowRootPickItemInterceptorContribution);
|
|
21331
|
+
var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21332
|
+
function DebugDrawItemInterceptorContribution() {
|
|
21333
|
+
_classCallCheck(this, DebugDrawItemInterceptorContribution);
|
|
21009
21334
|
this.order = 1;
|
|
21010
21335
|
}
|
|
21011
|
-
_createClass(
|
|
21012
|
-
key: "
|
|
21013
|
-
value: function
|
|
21014
|
-
return graphic.attribute.
|
|
21015
|
-
}
|
|
21016
|
-
}, {
|
|
21017
|
-
key: "beforePickItem",
|
|
21018
|
-
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21019
|
-
return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
21336
|
+
_createClass(DebugDrawItemInterceptorContribution, [{
|
|
21337
|
+
key: "afterDrawItem",
|
|
21338
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21339
|
+
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21020
21340
|
}
|
|
21021
21341
|
}, {
|
|
21022
|
-
key: "
|
|
21023
|
-
value: function
|
|
21024
|
-
if (!graphic.
|
|
21025
|
-
var
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
|
|
21029
|
-
context.highPerformanceSave();
|
|
21030
|
-
var g = graphic.shadowRoot,
|
|
21031
|
-
currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
|
|
21032
|
-
newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
|
|
21033
|
-
result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
21034
|
-
return context.highPerformanceRestore(), result;
|
|
21342
|
+
key: "drawItem",
|
|
21343
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21344
|
+
if (!graphic.attribute._debug_bounds) return !1;
|
|
21345
|
+
var context = drawContext.context;
|
|
21346
|
+
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21347
|
+
var b = graphic.AABBBounds;
|
|
21348
|
+
return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
|
|
21035
21349
|
}
|
|
21036
21350
|
}]);
|
|
21037
|
-
return
|
|
21351
|
+
return DebugDrawItemInterceptorContribution;
|
|
21038
21352
|
}();
|
|
21039
|
-
exports.
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
this.order = 1;
|
|
21353
|
+
exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21354
|
+
function CommonDrawItemInterceptorContribution() {
|
|
21355
|
+
_classCallCheck(this, CommonDrawItemInterceptorContribution);
|
|
21356
|
+
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21044
21357
|
}
|
|
21045
|
-
_createClass(
|
|
21046
|
-
key: "
|
|
21047
|
-
value: function
|
|
21048
|
-
var
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21358
|
+
_createClass(CommonDrawItemInterceptorContribution, [{
|
|
21359
|
+
key: "afterDrawItem",
|
|
21360
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21361
|
+
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21362
|
+
return !1;
|
|
21363
|
+
}
|
|
21364
|
+
}, {
|
|
21365
|
+
key: "beforeDrawItem",
|
|
21366
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21367
|
+
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21368
|
+
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21369
|
+
return !1;
|
|
21370
|
+
}
|
|
21371
|
+
}]);
|
|
21372
|
+
return CommonDrawItemInterceptorContribution;
|
|
21373
|
+
}();
|
|
21374
|
+
exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
|
|
21375
|
+
var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21376
|
+
function InteractiveDrawItemInterceptorContribution() {
|
|
21377
|
+
_classCallCheck(this, InteractiveDrawItemInterceptorContribution);
|
|
21378
|
+
this.order = 1;
|
|
21379
|
+
}
|
|
21380
|
+
_createClass(InteractiveDrawItemInterceptorContribution, [{
|
|
21381
|
+
key: "beforeDrawItem",
|
|
21382
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21383
|
+
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21384
|
+
}
|
|
21385
|
+
}, {
|
|
21386
|
+
key: "beforeSetInteractive",
|
|
21387
|
+
value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21388
|
+
var interactiveGraphic = graphic.interactiveGraphic;
|
|
21389
|
+
if (graphic.attribute.globalZIndex) {
|
|
21390
|
+
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21391
|
+
globalZIndex: 0,
|
|
21392
|
+
zIndex: graphic.attribute.globalZIndex
|
|
21393
|
+
}, !1, {
|
|
21394
|
+
skipUpdateCallback: !0
|
|
21395
|
+
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21396
|
+
var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21397
|
+
if (interactiveLayer) {
|
|
21398
|
+
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21399
|
+
}
|
|
21400
|
+
return !0;
|
|
21057
21401
|
}
|
|
21058
|
-
|
|
21402
|
+
if (interactiveGraphic) {
|
|
21403
|
+
drawContext.stage.tryInitInteractiveLayer();
|
|
21404
|
+
var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21405
|
+
if (_interactiveLayer) {
|
|
21406
|
+
this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
|
|
21407
|
+
}
|
|
21408
|
+
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21409
|
+
}
|
|
21410
|
+
return !1;
|
|
21411
|
+
}
|
|
21412
|
+
}, {
|
|
21413
|
+
key: "beforeDrawInteractive",
|
|
21414
|
+
value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21415
|
+
var baseGraphic = graphic.baseGraphic;
|
|
21416
|
+
if (baseGraphic) {
|
|
21417
|
+
this.processing = !0;
|
|
21418
|
+
var context = drawContext.context;
|
|
21419
|
+
return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
|
|
21420
|
+
}
|
|
21421
|
+
return !1;
|
|
21422
|
+
}
|
|
21423
|
+
}, {
|
|
21424
|
+
key: "getShadowRoot",
|
|
21425
|
+
value: function getShadowRoot(interactiveLayer) {
|
|
21426
|
+
var _a;
|
|
21427
|
+
var group = interactiveLayer.getElementById("_interactive_group");
|
|
21428
|
+
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21059
21429
|
}
|
|
21060
21430
|
}]);
|
|
21061
|
-
return
|
|
21431
|
+
return InteractiveDrawItemInterceptorContribution;
|
|
21062
21432
|
}();
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
_classCallCheck(this, Canvas3DPickItemInterceptor);
|
|
21433
|
+
var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
|
|
21434
|
+
function Canvas3DDrawItemInterceptor() {
|
|
21435
|
+
_classCallCheck(this, Canvas3DDrawItemInterceptor);
|
|
21067
21436
|
this.order = 1;
|
|
21068
21437
|
}
|
|
21069
|
-
_createClass(
|
|
21070
|
-
key: "
|
|
21071
|
-
value: function
|
|
21072
|
-
if (!graphic.in3dMode ||
|
|
21073
|
-
|
|
21074
|
-
|
|
21075
|
-
|
|
21076
|
-
|
|
21077
|
-
|
|
21078
|
-
|
|
21438
|
+
_createClass(Canvas3DDrawItemInterceptor, [{
|
|
21439
|
+
key: "beforeDrawItem",
|
|
21440
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21441
|
+
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21442
|
+
drawContext.in3dInterceptor = !0;
|
|
21443
|
+
var _renderService$drawPa = renderService.drawParams,
|
|
21444
|
+
context = _renderService$drawPa.context,
|
|
21445
|
+
stage = _renderService$drawPa.stage;
|
|
21446
|
+
context.canvas;
|
|
21447
|
+
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21448
|
+
var m = context.currentMatrix;
|
|
21449
|
+
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21450
|
+
var matrix = mat4Allocate.allocate();
|
|
21451
|
+
mat3Tomat4(matrix, m);
|
|
21452
|
+
var lastModelMatrix = context.modelMatrix;
|
|
21453
|
+
if (lastModelMatrix) {
|
|
21454
|
+
if (matrix) {
|
|
21455
|
+
var _m = mat4Allocate.allocate();
|
|
21456
|
+
context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
|
|
21457
|
+
}
|
|
21458
|
+
} else context.modelMatrix = matrix;
|
|
21459
|
+
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21460
|
+
var isPie = !1,
|
|
21079
21461
|
is3d = !1;
|
|
21080
21462
|
if (graphic.forEachChildren(function (c) {
|
|
21081
21463
|
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
@@ -21086,8 +21468,8 @@
|
|
|
21086
21468
|
sortedChildren = _toConsumableArray(children);
|
|
21087
21469
|
sortedChildren.sort(function (a, b) {
|
|
21088
21470
|
var _a, _b, _c, _d;
|
|
21089
|
-
var angle1 = (
|
|
21090
|
-
angle2 = (
|
|
21471
|
+
var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21472
|
+
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21091
21473
|
for (; angle1 < 0;) angle1 += pi2;
|
|
21092
21474
|
for (; angle2 < 0;) angle2 += pi2;
|
|
21093
21475
|
return angle2 - angle1;
|
|
@@ -21095,7 +21477,9 @@
|
|
|
21095
21477
|
c._next = null, c._prev = null;
|
|
21096
21478
|
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
21097
21479
|
graphic.appendChild(c);
|
|
21098
|
-
})
|
|
21480
|
+
});
|
|
21481
|
+
var _m2 = graphic.parent.globalTransMatrix;
|
|
21482
|
+
drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
|
|
21099
21483
|
c._next = null, c._prev = null;
|
|
21100
21484
|
}), children.forEach(function (c) {
|
|
21101
21485
|
graphic.appendChild(c);
|
|
@@ -21119,15 +21503,14 @@
|
|
|
21119
21503
|
i.g._next = null, i.g._prev = null;
|
|
21120
21504
|
}), graphic.update(), zChildren.forEach(function (i) {
|
|
21121
21505
|
graphic.add(i.g);
|
|
21122
|
-
}),
|
|
21506
|
+
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
21123
21507
|
g._next = null, g._prev = null;
|
|
21124
21508
|
}), graphic.update(), _children.forEach(function (g) {
|
|
21125
21509
|
graphic.add(g);
|
|
21126
21510
|
});
|
|
21127
|
-
} else
|
|
21128
|
-
|
|
21129
|
-
|
|
21130
|
-
return context.restore(), null;
|
|
21511
|
+
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21512
|
+
} else drawContribution.renderItem(graphic, drawContext);
|
|
21513
|
+
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21131
21514
|
}
|
|
21132
21515
|
}, {
|
|
21133
21516
|
key: "initCanvasCtx",
|
|
@@ -21135,22 +21518,10 @@
|
|
|
21135
21518
|
context.setTransformForCurrent();
|
|
21136
21519
|
}
|
|
21137
21520
|
}]);
|
|
21138
|
-
return
|
|
21521
|
+
return Canvas3DDrawItemInterceptor;
|
|
21139
21522
|
}();
|
|
21140
|
-
exports.Canvas3DPickItemInterceptor = __decorate$1i([injectable()], exports.Canvas3DPickItemInterceptor);
|
|
21141
|
-
|
|
21142
|
-
var pickModule = new ContainerModule(function (bind, unbind, isBound) {
|
|
21143
|
-
isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
|
|
21144
|
-
});
|
|
21145
|
-
|
|
21146
|
-
var graphicModule = new ContainerModule(function (bind) {
|
|
21147
|
-
bind(GraphicService).to(exports.DefaultGraphicService).inSingletonScope(), bind(GraphicCreator$1).toConstantValue(graphicCreator);
|
|
21148
|
-
});
|
|
21149
21523
|
|
|
21150
|
-
var
|
|
21151
|
-
var PluginService = Symbol["for"]("PluginService");
|
|
21152
|
-
|
|
21153
|
-
var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21524
|
+
var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21154
21525
|
var d,
|
|
21155
21526
|
c = arguments.length,
|
|
21156
21527
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
@@ -21160,91 +21531,324 @@
|
|
|
21160
21531
|
__metadata$_ = undefined && undefined.__metadata || function (k, v) {
|
|
21161
21532
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21162
21533
|
},
|
|
21163
|
-
__param$
|
|
21534
|
+
__param$E = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
21164
21535
|
return function (target, key) {
|
|
21165
21536
|
decorator(target, key, paramIndex);
|
|
21166
21537
|
};
|
|
21167
21538
|
};
|
|
21168
|
-
var
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21539
|
+
var RenderService = Symbol["for"]("RenderService");
|
|
21540
|
+
var BeforeRenderConstribution = Symbol["for"]("BeforeRenderConstribution");
|
|
21541
|
+
exports.DefaultRenderService = /*#__PURE__*/function () {
|
|
21542
|
+
function DefaultRenderService(drawContribution) {
|
|
21543
|
+
_classCallCheck(this, DefaultRenderService);
|
|
21544
|
+
this.drawContribution = drawContribution;
|
|
21172
21545
|
}
|
|
21173
|
-
_createClass(
|
|
21174
|
-
key: "
|
|
21175
|
-
value: function
|
|
21546
|
+
_createClass(DefaultRenderService, [{
|
|
21547
|
+
key: "prepare",
|
|
21548
|
+
value: function prepare(updateBounds) {
|
|
21176
21549
|
var _this = this;
|
|
21177
|
-
|
|
21178
|
-
|
|
21179
|
-
pluginList && container.isBound(AutoEnablePlugins) && this.autoEnablePlugins.getContributions().forEach(function (p) {
|
|
21180
|
-
pluginList.includes(p.name) && _this.register(p);
|
|
21550
|
+
updateBounds && this.renderTreeRoots.forEach(function (g) {
|
|
21551
|
+
_this._prepare(g, updateBounds);
|
|
21181
21552
|
});
|
|
21182
21553
|
}
|
|
21183
21554
|
}, {
|
|
21184
|
-
key: "
|
|
21185
|
-
value: function
|
|
21186
|
-
var
|
|
21187
|
-
|
|
21188
|
-
|
|
21189
|
-
}),
|
|
21190
|
-
|
|
21191
|
-
|
|
21555
|
+
key: "_prepare",
|
|
21556
|
+
value: function _prepare(g, updateBounds) {
|
|
21557
|
+
var _this2 = this;
|
|
21558
|
+
g.forEachChildren(function (g) {
|
|
21559
|
+
_this2._prepare(g, updateBounds);
|
|
21560
|
+
}), g.update({
|
|
21561
|
+
bounds: updateBounds,
|
|
21562
|
+
trans: !0
|
|
21563
|
+
});
|
|
21192
21564
|
}
|
|
21193
21565
|
}, {
|
|
21194
|
-
key: "
|
|
21195
|
-
value: function
|
|
21196
|
-
|
|
21566
|
+
key: "prepareRenderList",
|
|
21567
|
+
value: function prepareRenderList() {}
|
|
21568
|
+
}, {
|
|
21569
|
+
key: "beforeDraw",
|
|
21570
|
+
value: function beforeDraw(params) {}
|
|
21571
|
+
}, {
|
|
21572
|
+
key: "draw",
|
|
21573
|
+
value: function draw(params) {
|
|
21574
|
+
this.drawContribution.draw(this, Object.assign({}, this.drawParams));
|
|
21197
21575
|
}
|
|
21198
21576
|
}, {
|
|
21199
|
-
key: "
|
|
21200
|
-
value: function
|
|
21201
|
-
|
|
21577
|
+
key: "afterDraw",
|
|
21578
|
+
value: function afterDraw(params) {
|
|
21579
|
+
this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
|
|
21202
21580
|
}
|
|
21203
21581
|
}, {
|
|
21204
|
-
key: "
|
|
21205
|
-
value: function
|
|
21206
|
-
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
|
-
}), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(function (plugin) {
|
|
21210
|
-
plugin.deactivate(_this2);
|
|
21211
|
-
}), this.onRegisterPlugin = [];
|
|
21582
|
+
key: "render",
|
|
21583
|
+
value: function render(groups, params) {
|
|
21584
|
+
this.renderTreeRoots = groups, this.drawParams = params;
|
|
21585
|
+
var updateBounds = params.updateBounds;
|
|
21586
|
+
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
|
|
21212
21587
|
}
|
|
21213
21588
|
}]);
|
|
21214
|
-
return
|
|
21589
|
+
return DefaultRenderService;
|
|
21215
21590
|
}();
|
|
21216
|
-
|
|
21217
|
-
|
|
21218
|
-
var pluginModule = new ContainerModule(function (bind) {
|
|
21219
|
-
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
21220
|
-
});
|
|
21591
|
+
exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
|
|
21221
21592
|
|
|
21222
|
-
var
|
|
21223
|
-
|
|
21593
|
+
var renderModule$1 = new ContainerModule(function (bind) {
|
|
21594
|
+
bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
|
|
21224
21595
|
});
|
|
21225
21596
|
|
|
21226
|
-
var
|
|
21227
|
-
|
|
21228
|
-
|
|
21597
|
+
var GraphicPicker = Symbol["for"]("GraphicPicker");
|
|
21598
|
+
var PickerService = Symbol["for"]("PickerService");
|
|
21599
|
+
var BoundsPicker = Symbol["for"]("BoundsPicker");
|
|
21600
|
+
var GlobalPickerService = Symbol["for"]("GlobalPickerService");
|
|
21229
21601
|
|
|
21230
|
-
var __decorate$
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
|
|
21240
|
-
|
|
21241
|
-
|
|
21242
|
-
|
|
21243
|
-
|
|
21244
|
-
|
|
21245
|
-
|
|
21246
|
-
|
|
21247
|
-
|
|
21602
|
+
var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21603
|
+
var d,
|
|
21604
|
+
c = arguments.length,
|
|
21605
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21606
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21607
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21608
|
+
};
|
|
21609
|
+
var PickItemInterceptor = Symbol["for"]("PickItemInterceptor");
|
|
21610
|
+
exports.ShadowRootPickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21611
|
+
function ShadowRootPickItemInterceptorContribution() {
|
|
21612
|
+
_classCallCheck(this, ShadowRootPickItemInterceptorContribution);
|
|
21613
|
+
this.order = 1;
|
|
21614
|
+
}
|
|
21615
|
+
_createClass(ShadowRootPickItemInterceptorContribution, [{
|
|
21616
|
+
key: "afterPickItem",
|
|
21617
|
+
value: function afterPickItem(graphic, pickerService, point, pickParams, params) {
|
|
21618
|
+
return graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
21619
|
+
}
|
|
21620
|
+
}, {
|
|
21621
|
+
key: "beforePickItem",
|
|
21622
|
+
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21623
|
+
return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
21624
|
+
}
|
|
21625
|
+
}, {
|
|
21626
|
+
key: "_pickItem",
|
|
21627
|
+
value: function _pickItem(graphic, pickerService, point, pickParams, params) {
|
|
21628
|
+
if (!graphic.shadowRoot) return null;
|
|
21629
|
+
var _ref = params || {},
|
|
21630
|
+
parentMatrix = _ref.parentMatrix;
|
|
21631
|
+
if (!parentMatrix) return null;
|
|
21632
|
+
var context = pickerService.pickContext;
|
|
21633
|
+
context.highPerformanceSave();
|
|
21634
|
+
var g = graphic.shadowRoot,
|
|
21635
|
+
currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
|
|
21636
|
+
newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
|
|
21637
|
+
result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
21638
|
+
return context.highPerformanceRestore(), result;
|
|
21639
|
+
}
|
|
21640
|
+
}]);
|
|
21641
|
+
return ShadowRootPickItemInterceptorContribution;
|
|
21642
|
+
}();
|
|
21643
|
+
exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
|
|
21644
|
+
exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21645
|
+
function InteractivePickItemInterceptorContribution() {
|
|
21646
|
+
_classCallCheck(this, InteractivePickItemInterceptorContribution);
|
|
21647
|
+
this.order = 1;
|
|
21648
|
+
}
|
|
21649
|
+
_createClass(InteractivePickItemInterceptorContribution, [{
|
|
21650
|
+
key: "beforePickItem",
|
|
21651
|
+
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21652
|
+
var originGraphic = graphic.baseGraphic;
|
|
21653
|
+
if (originGraphic && originGraphic.parent) {
|
|
21654
|
+
var newPoint = new Point(point.x, point.y),
|
|
21655
|
+
context = pickerService.pickContext;
|
|
21656
|
+
context.highPerformanceSave();
|
|
21657
|
+
var parentMatrix = originGraphic.parent.globalTransMatrix;
|
|
21658
|
+
parentMatrix.transformPoint(newPoint, newPoint);
|
|
21659
|
+
var result = originGraphic.isContainer ? pickerService.pickGroup(originGraphic, newPoint.clone(), parentMatrix, pickParams) : pickerService.pickItem(originGraphic, newPoint.clone(), parentMatrix, pickParams);
|
|
21660
|
+
return context.highPerformanceRestore(), result;
|
|
21661
|
+
}
|
|
21662
|
+
return null;
|
|
21663
|
+
}
|
|
21664
|
+
}]);
|
|
21665
|
+
return InteractivePickItemInterceptorContribution;
|
|
21666
|
+
}();
|
|
21667
|
+
exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
|
|
21668
|
+
exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
|
|
21669
|
+
function Canvas3DPickItemInterceptor() {
|
|
21670
|
+
_classCallCheck(this, Canvas3DPickItemInterceptor);
|
|
21671
|
+
this.order = 1;
|
|
21672
|
+
}
|
|
21673
|
+
_createClass(Canvas3DPickItemInterceptor, [{
|
|
21674
|
+
key: "beforePickItem",
|
|
21675
|
+
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21676
|
+
if (!graphic.in3dMode || pickParams.in3dInterceptor) return null;
|
|
21677
|
+
var context = pickerService.pickContext,
|
|
21678
|
+
stage = graphic.stage;
|
|
21679
|
+
if (!context || !stage) return null;
|
|
21680
|
+
if (pickParams.in3dInterceptor = !0, context.save(), this.initCanvasCtx(context), context.camera = stage.camera, graphic.isContainer) {
|
|
21681
|
+
var result,
|
|
21682
|
+
isPie = !1,
|
|
21683
|
+
is3d = !1;
|
|
21684
|
+
if (graphic.forEachChildren(function (c) {
|
|
21685
|
+
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
21686
|
+
}), graphic.forEachChildren(function (c) {
|
|
21687
|
+
return is3d = !!c.findFace, !is3d;
|
|
21688
|
+
}), isPie) {
|
|
21689
|
+
var children = graphic.getChildren(),
|
|
21690
|
+
sortedChildren = _toConsumableArray(children);
|
|
21691
|
+
sortedChildren.sort(function (a, b) {
|
|
21692
|
+
var _a, _b, _c, _d;
|
|
21693
|
+
var angle1 = (null !== (_b = null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0 + a.attribute.endAngle) && void 0 !== _b ? _b : 0) / 2,
|
|
21694
|
+
angle2 = (null !== (_d = null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0 + b.attribute.endAngle) && void 0 !== _d ? _d : 0) / 2;
|
|
21695
|
+
for (; angle1 < 0;) angle1 += pi2;
|
|
21696
|
+
for (; angle2 < 0;) angle2 += pi2;
|
|
21697
|
+
return angle2 - angle1;
|
|
21698
|
+
}), sortedChildren.forEach(function (c) {
|
|
21699
|
+
c._next = null, c._prev = null;
|
|
21700
|
+
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
21701
|
+
graphic.appendChild(c);
|
|
21702
|
+
}), pickParams.hack_pieFace = "outside", result = pickerService.pickGroup(graphic, point, params.parentMatrix, pickParams), result.graphic || (pickParams.hack_pieFace = "inside", result = pickerService.pickGroup(graphic, point, params.parentMatrix, pickParams)), result.graphic || (pickParams.hack_pieFace = "top", result = pickerService.pickGroup(graphic, point, params.parentMatrix, pickParams)), graphic.removeAllChild(), children.forEach(function (c) {
|
|
21703
|
+
c._next = null, c._prev = null;
|
|
21704
|
+
}), children.forEach(function (c) {
|
|
21705
|
+
graphic.appendChild(c);
|
|
21706
|
+
});
|
|
21707
|
+
} else if (is3d) {
|
|
21708
|
+
var _children = graphic.getChildren(),
|
|
21709
|
+
zChildren = _children.map(function (g) {
|
|
21710
|
+
return {
|
|
21711
|
+
ave_z: g.findFace().vertices.map(function (v) {
|
|
21712
|
+
var _a;
|
|
21713
|
+
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21714
|
+
}).reduce(function (a, b) {
|
|
21715
|
+
return a + b;
|
|
21716
|
+
}, 0),
|
|
21717
|
+
g: g
|
|
21718
|
+
};
|
|
21719
|
+
});
|
|
21720
|
+
zChildren.sort(function (a, b) {
|
|
21721
|
+
return b.ave_z - a.ave_z;
|
|
21722
|
+
}), graphic.removeAllChild(), zChildren.forEach(function (i) {
|
|
21723
|
+
i.g._next = null, i.g._prev = null;
|
|
21724
|
+
}), graphic.update(), zChildren.forEach(function (i) {
|
|
21725
|
+
graphic.add(i.g);
|
|
21726
|
+
}), result = pickerService.pickGroup(graphic, point, params.parentMatrix, pickParams), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
21727
|
+
g._next = null, g._prev = null;
|
|
21728
|
+
}), graphic.update(), _children.forEach(function (g) {
|
|
21729
|
+
graphic.add(g);
|
|
21730
|
+
});
|
|
21731
|
+
} else result = pickerService.pickGroup(graphic, point, params.parentMatrix, pickParams);
|
|
21732
|
+
return context.camera = null, pickParams.in3dInterceptor = !1, context.restore(), result;
|
|
21733
|
+
}
|
|
21734
|
+
return context.restore(), null;
|
|
21735
|
+
}
|
|
21736
|
+
}, {
|
|
21737
|
+
key: "initCanvasCtx",
|
|
21738
|
+
value: function initCanvasCtx(context) {
|
|
21739
|
+
context.setTransformForCurrent();
|
|
21740
|
+
}
|
|
21741
|
+
}]);
|
|
21742
|
+
return Canvas3DPickItemInterceptor;
|
|
21743
|
+
}();
|
|
21744
|
+
exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
|
|
21745
|
+
|
|
21746
|
+
var pickModule = new ContainerModule(function (bind, unbind, isBound) {
|
|
21747
|
+
isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
|
|
21748
|
+
});
|
|
21749
|
+
|
|
21750
|
+
var graphicModule = new ContainerModule(function (bind) {
|
|
21751
|
+
bind(GraphicService).to(exports.DefaultGraphicService).inSingletonScope(), bind(GraphicCreator$1).toConstantValue(graphicCreator);
|
|
21752
|
+
});
|
|
21753
|
+
|
|
21754
|
+
var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
|
|
21755
|
+
var PluginService = Symbol["for"]("PluginService");
|
|
21756
|
+
|
|
21757
|
+
var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21758
|
+
var d,
|
|
21759
|
+
c = arguments.length,
|
|
21760
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21761
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21762
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21763
|
+
},
|
|
21764
|
+
__metadata$Z = undefined && undefined.__metadata || function (k, v) {
|
|
21765
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21766
|
+
},
|
|
21767
|
+
__param$D = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
21768
|
+
return function (target, key) {
|
|
21769
|
+
decorator(target, key, paramIndex);
|
|
21770
|
+
};
|
|
21771
|
+
};
|
|
21772
|
+
var DefaultPluginService = /*#__PURE__*/function () {
|
|
21773
|
+
function DefaultPluginService(autoEnablePlugins) {
|
|
21774
|
+
_classCallCheck(this, DefaultPluginService);
|
|
21775
|
+
this.autoEnablePlugins = autoEnablePlugins, this.onStartupFinishedPlugin = [], this.onRegisterPlugin = [], this.actived = !1;
|
|
21776
|
+
}
|
|
21777
|
+
_createClass(DefaultPluginService, [{
|
|
21778
|
+
key: "active",
|
|
21779
|
+
value: function active(stage, params) {
|
|
21780
|
+
var _this = this;
|
|
21781
|
+
this.stage = stage, this.actived = !0;
|
|
21782
|
+
var pluginList = params.pluginList;
|
|
21783
|
+
pluginList && container.isBound(AutoEnablePlugins) && this.autoEnablePlugins.getContributions().forEach(function (p) {
|
|
21784
|
+
pluginList.includes(p.name) && _this.register(p);
|
|
21785
|
+
});
|
|
21786
|
+
}
|
|
21787
|
+
}, {
|
|
21788
|
+
key: "findPluginsByName",
|
|
21789
|
+
value: function findPluginsByName(name) {
|
|
21790
|
+
var arr = [];
|
|
21791
|
+
return this.onStartupFinishedPlugin.forEach(function (plugin) {
|
|
21792
|
+
plugin.name === name && arr.push(plugin);
|
|
21793
|
+
}), this.onRegisterPlugin.forEach(function (plugin) {
|
|
21794
|
+
plugin.name === name && arr.push(plugin);
|
|
21795
|
+
}), arr;
|
|
21796
|
+
}
|
|
21797
|
+
}, {
|
|
21798
|
+
key: "register",
|
|
21799
|
+
value: function register(plugin) {
|
|
21800
|
+
"onStartupFinished" === plugin.activeEvent ? this.onStartupFinishedPlugin.push(plugin) : "onRegister" === plugin.activeEvent && (this.onRegisterPlugin.push(plugin), plugin.activate(this));
|
|
21801
|
+
}
|
|
21802
|
+
}, {
|
|
21803
|
+
key: "unRegister",
|
|
21804
|
+
value: function unRegister(plugin) {
|
|
21805
|
+
"onStartupFinished" === plugin.activeEvent ? this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1) : "onRegister" === plugin.activeEvent && this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1), plugin.deactivate(this);
|
|
21806
|
+
}
|
|
21807
|
+
}, {
|
|
21808
|
+
key: "release",
|
|
21809
|
+
value: function release() {
|
|
21810
|
+
var _this2 = this;
|
|
21811
|
+
this.onStartupFinishedPlugin.forEach(function (plugin) {
|
|
21812
|
+
plugin.deactivate(_this2);
|
|
21813
|
+
}), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(function (plugin) {
|
|
21814
|
+
plugin.deactivate(_this2);
|
|
21815
|
+
}), this.onRegisterPlugin = [];
|
|
21816
|
+
}
|
|
21817
|
+
}]);
|
|
21818
|
+
return DefaultPluginService;
|
|
21819
|
+
}();
|
|
21820
|
+
DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
|
|
21821
|
+
|
|
21822
|
+
var pluginModule = new ContainerModule(function (bind) {
|
|
21823
|
+
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
21824
|
+
});
|
|
21825
|
+
|
|
21826
|
+
var envModules = new ContainerModule(function (bind) {
|
|
21827
|
+
bindContributionProvider(bind, EnvContribution);
|
|
21828
|
+
});
|
|
21829
|
+
|
|
21830
|
+
var textMeasureModules = new ContainerModule(function (bind) {
|
|
21831
|
+
bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
21832
|
+
});
|
|
21833
|
+
|
|
21834
|
+
var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21835
|
+
var d,
|
|
21836
|
+
c = arguments.length,
|
|
21837
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21838
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21839
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21840
|
+
},
|
|
21841
|
+
__metadata$Y = undefined && undefined.__metadata || function (k, v) {
|
|
21842
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21843
|
+
};
|
|
21844
|
+
var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
|
|
21845
|
+
function CanvasLayerHandlerContribution() {
|
|
21846
|
+
_classCallCheck(this, CanvasLayerHandlerContribution);
|
|
21847
|
+
this.type = "static", this.offscreen = !1, this.global = application.global;
|
|
21848
|
+
}
|
|
21849
|
+
_createClass(CanvasLayerHandlerContribution, [{
|
|
21850
|
+
key: "setDpr",
|
|
21851
|
+
value: function setDpr(dpr) {
|
|
21248
21852
|
this.canvas.dpr = dpr;
|
|
21249
21853
|
}
|
|
21250
21854
|
}, {
|
|
@@ -21328,16 +21932,16 @@
|
|
|
21328
21932
|
}]);
|
|
21329
21933
|
return CanvasLayerHandlerContribution;
|
|
21330
21934
|
}();
|
|
21331
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
21935
|
+
CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
21332
21936
|
|
|
21333
|
-
var __decorate$
|
|
21937
|
+
var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21334
21938
|
var d,
|
|
21335
21939
|
c = arguments.length,
|
|
21336
21940
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21337
21941
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21338
21942
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21339
21943
|
},
|
|
21340
|
-
__metadata$
|
|
21944
|
+
__metadata$X = undefined && undefined.__metadata || function (k, v) {
|
|
21341
21945
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21342
21946
|
};
|
|
21343
21947
|
var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21395,16 +21999,16 @@
|
|
|
21395
21999
|
}]);
|
|
21396
22000
|
return EmptyLayerHandlerContribution;
|
|
21397
22001
|
}();
|
|
21398
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
22002
|
+
EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
21399
22003
|
|
|
21400
|
-
var __decorate$
|
|
22004
|
+
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21401
22005
|
var d,
|
|
21402
22006
|
c = arguments.length,
|
|
21403
22007
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21404
22008
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21405
22009
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21406
22010
|
},
|
|
21407
|
-
__metadata$
|
|
22011
|
+
__metadata$W = undefined && undefined.__metadata || function (k, v) {
|
|
21408
22012
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21409
22013
|
};
|
|
21410
22014
|
var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21491,7 +22095,7 @@
|
|
|
21491
22095
|
}]);
|
|
21492
22096
|
return OffscreenLayerHandlerContribution;
|
|
21493
22097
|
}();
|
|
21494
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
22098
|
+
OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
21495
22099
|
|
|
21496
22100
|
var layerHandlerModules = new ContainerModule(function (bind) {
|
|
21497
22101
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -21565,333 +22169,58 @@
|
|
|
21565
22169
|
} else graphic.forEachChildren(cb, reverse);
|
|
21566
22170
|
}
|
|
21567
22171
|
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
21568
|
-
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
21569
|
-
return __awaiter$2(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
21570
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
21571
|
-
while (1) switch (_context.prev = _context.next) {
|
|
21572
|
-
case 0:
|
|
21573
|
-
_context.next = 2;
|
|
21574
|
-
return graphic.forEachChildrenAsync(cb, reverse);
|
|
21575
|
-
case 2:
|
|
21576
|
-
case "end":
|
|
21577
|
-
return _context.stop();
|
|
21578
|
-
}
|
|
21579
|
-
}, _callee);
|
|
21580
|
-
}));
|
|
21581
|
-
}
|
|
21582
|
-
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
21583
|
-
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
21584
|
-
var childMap = {},
|
|
21585
|
-
zIdxArray = [];
|
|
21586
|
-
var needSort = !1;
|
|
21587
|
-
graphic.forEachChildren(function (item, i) {
|
|
21588
|
-
var _item$attribute$zInde3 = item.attribute.zIndex,
|
|
21589
|
-
zIndex = _item$attribute$zInde3 === void 0 ? defaultZIndex : _item$attribute$zInde3;
|
|
21590
|
-
if (0 === i) ;else if (undefined !== zIndex) return needSort = !0, !0;
|
|
21591
|
-
return !1;
|
|
21592
|
-
}, reverse);
|
|
21593
|
-
var result = null,
|
|
21594
|
-
next = !1;
|
|
21595
|
-
if (needSort) {
|
|
21596
|
-
graphic.forEachChildren(function (item) {
|
|
21597
|
-
var _item$attribute$zInde4 = item.attribute.zIndex,
|
|
21598
|
-
zIndex = _item$attribute$zInde4 === void 0 ? defaultZIndex : _item$attribute$zInde4;
|
|
21599
|
-
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
|
|
21600
|
-
}, reverse), zIdxArray.sort(function (a, b) {
|
|
21601
|
-
return reverse ? b - a : a - b;
|
|
21602
|
-
});
|
|
21603
|
-
var skip = !1;
|
|
21604
|
-
for (var i = 0; i < zIdxArray.length && !skip; i++) {
|
|
21605
|
-
var idx = zIdxArray[i],
|
|
21606
|
-
children = childMap[idx];
|
|
21607
|
-
for (var _i2 = 0; _i2 < children.length; _i2++) {
|
|
21608
|
-
if (next) {
|
|
21609
|
-
skip = !0, result = children[_i2];
|
|
21610
|
-
break;
|
|
21611
|
-
}
|
|
21612
|
-
children[_i2]._uid !== id || (next = !0);
|
|
21613
|
-
}
|
|
21614
|
-
}
|
|
21615
|
-
} else graphic.forEachChildren(function (item) {
|
|
21616
|
-
return next ? (result = item, !0) : (item._uid === id && (next = !0), !1);
|
|
21617
|
-
}, reverse);
|
|
21618
|
-
return result;
|
|
21619
|
-
}
|
|
21620
|
-
|
|
21621
|
-
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21622
|
-
var d,
|
|
21623
|
-
c = arguments.length,
|
|
21624
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21625
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21626
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21627
|
-
},
|
|
21628
|
-
__metadata$W = undefined && undefined.__metadata || function (k, v) {
|
|
21629
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21630
|
-
};
|
|
21631
|
-
var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
|
|
21632
|
-
var tempDirtyBounds = new AABBBounds();
|
|
21633
|
-
var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21634
|
-
function ShadowRootDrawItemInterceptorContribution() {
|
|
21635
|
-
_classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
|
|
21636
|
-
this.order = 1;
|
|
21637
|
-
}
|
|
21638
|
-
_createClass(ShadowRootDrawItemInterceptorContribution, [{
|
|
21639
|
-
key: "afterDrawItem",
|
|
21640
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21641
|
-
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21642
|
-
}
|
|
21643
|
-
}, {
|
|
21644
|
-
key: "beforeDrawItem",
|
|
21645
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21646
|
-
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21647
|
-
}
|
|
21648
|
-
}, {
|
|
21649
|
-
key: "drawItem",
|
|
21650
|
-
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21651
|
-
if (!graphic.shadowRoot) return !1;
|
|
21652
|
-
var context = drawContext.context;
|
|
21653
|
-
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21654
|
-
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21655
|
-
var m = graphic.globalTransMatrix.getInverse();
|
|
21656
|
-
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21657
|
-
}
|
|
21658
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21659
|
-
}
|
|
21660
|
-
}]);
|
|
21661
|
-
return ShadowRootDrawItemInterceptorContribution;
|
|
21662
|
-
}();
|
|
21663
|
-
var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21664
|
-
function DebugDrawItemInterceptorContribution() {
|
|
21665
|
-
_classCallCheck(this, DebugDrawItemInterceptorContribution);
|
|
21666
|
-
this.order = 1;
|
|
21667
|
-
}
|
|
21668
|
-
_createClass(DebugDrawItemInterceptorContribution, [{
|
|
21669
|
-
key: "afterDrawItem",
|
|
21670
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21671
|
-
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21672
|
-
}
|
|
21673
|
-
}, {
|
|
21674
|
-
key: "drawItem",
|
|
21675
|
-
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21676
|
-
if (!graphic.attribute._debug_bounds) return !1;
|
|
21677
|
-
var context = drawContext.context;
|
|
21678
|
-
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21679
|
-
var b = graphic.AABBBounds;
|
|
21680
|
-
return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
|
|
21681
|
-
}
|
|
21682
|
-
}]);
|
|
21683
|
-
return DebugDrawItemInterceptorContribution;
|
|
21684
|
-
}();
|
|
21685
|
-
var CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21686
|
-
function CommonDrawItemInterceptorContribution() {
|
|
21687
|
-
_classCallCheck(this, CommonDrawItemInterceptorContribution);
|
|
21688
|
-
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21689
|
-
}
|
|
21690
|
-
_createClass(CommonDrawItemInterceptorContribution, [{
|
|
21691
|
-
key: "afterDrawItem",
|
|
21692
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21693
|
-
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21694
|
-
return !1;
|
|
21695
|
-
}
|
|
21696
|
-
}, {
|
|
21697
|
-
key: "beforeDrawItem",
|
|
21698
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21699
|
-
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21700
|
-
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21701
|
-
return !1;
|
|
21702
|
-
}
|
|
21703
|
-
}]);
|
|
21704
|
-
return CommonDrawItemInterceptorContribution;
|
|
21705
|
-
}();
|
|
21706
|
-
CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
21707
|
-
var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21708
|
-
function InteractiveDrawItemInterceptorContribution() {
|
|
21709
|
-
_classCallCheck(this, InteractiveDrawItemInterceptorContribution);
|
|
21710
|
-
this.order = 1;
|
|
21711
|
-
}
|
|
21712
|
-
_createClass(InteractiveDrawItemInterceptorContribution, [{
|
|
21713
|
-
key: "beforeDrawItem",
|
|
21714
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21715
|
-
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21716
|
-
}
|
|
21717
|
-
}, {
|
|
21718
|
-
key: "beforeSetInteractive",
|
|
21719
|
-
value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21720
|
-
var interactiveGraphic = graphic.interactiveGraphic;
|
|
21721
|
-
if (graphic.attribute.globalZIndex) {
|
|
21722
|
-
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21723
|
-
globalZIndex: 0,
|
|
21724
|
-
zIndex: graphic.attribute.globalZIndex
|
|
21725
|
-
}, !1, {
|
|
21726
|
-
skipUpdateCallback: !0
|
|
21727
|
-
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21728
|
-
var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21729
|
-
if (interactiveLayer) {
|
|
21730
|
-
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21731
|
-
}
|
|
21732
|
-
return !0;
|
|
21733
|
-
}
|
|
21734
|
-
if (interactiveGraphic) {
|
|
21735
|
-
drawContext.stage.tryInitInteractiveLayer();
|
|
21736
|
-
var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21737
|
-
if (_interactiveLayer) {
|
|
21738
|
-
this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
|
|
21739
|
-
}
|
|
21740
|
-
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21741
|
-
}
|
|
21742
|
-
return !1;
|
|
21743
|
-
}
|
|
21744
|
-
}, {
|
|
21745
|
-
key: "beforeDrawInteractive",
|
|
21746
|
-
value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21747
|
-
var baseGraphic = graphic.baseGraphic;
|
|
21748
|
-
if (baseGraphic) {
|
|
21749
|
-
this.processing = !0;
|
|
21750
|
-
var context = drawContext.context;
|
|
21751
|
-
return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
|
|
21752
|
-
}
|
|
21753
|
-
return !1;
|
|
21754
|
-
}
|
|
21755
|
-
}, {
|
|
21756
|
-
key: "getShadowRoot",
|
|
21757
|
-
value: function getShadowRoot(interactiveLayer) {
|
|
21758
|
-
var _a;
|
|
21759
|
-
var group = interactiveLayer.getElementById("_interactive_group");
|
|
21760
|
-
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21761
|
-
}
|
|
21762
|
-
}]);
|
|
21763
|
-
return InteractiveDrawItemInterceptorContribution;
|
|
21764
|
-
}();
|
|
21765
|
-
var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
|
|
21766
|
-
function Canvas3DDrawItemInterceptor() {
|
|
21767
|
-
_classCallCheck(this, Canvas3DDrawItemInterceptor);
|
|
21768
|
-
this.order = 1;
|
|
21769
|
-
}
|
|
21770
|
-
_createClass(Canvas3DDrawItemInterceptor, [{
|
|
21771
|
-
key: "beforeDrawItem",
|
|
21772
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21773
|
-
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21774
|
-
drawContext.in3dInterceptor = !0;
|
|
21775
|
-
var _renderService$drawPa = renderService.drawParams,
|
|
21776
|
-
context = _renderService$drawPa.context,
|
|
21777
|
-
stage = _renderService$drawPa.stage;
|
|
21778
|
-
context.canvas;
|
|
21779
|
-
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21780
|
-
var m = context.currentMatrix;
|
|
21781
|
-
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21782
|
-
var matrix = mat4Allocate.allocate();
|
|
21783
|
-
mat3Tomat4(matrix, m);
|
|
21784
|
-
var lastModelMatrix = context.modelMatrix;
|
|
21785
|
-
if (lastModelMatrix) {
|
|
21786
|
-
if (matrix) {
|
|
21787
|
-
var _m = mat4Allocate.allocate();
|
|
21788
|
-
context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
|
|
21789
|
-
}
|
|
21790
|
-
} else context.modelMatrix = matrix;
|
|
21791
|
-
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21792
|
-
var isPie = !1,
|
|
21793
|
-
is3d = !1;
|
|
21794
|
-
if (graphic.forEachChildren(function (c) {
|
|
21795
|
-
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
21796
|
-
}), graphic.forEachChildren(function (c) {
|
|
21797
|
-
return is3d = !!c.findFace, !is3d;
|
|
21798
|
-
}), isPie) {
|
|
21799
|
-
var children = graphic.getChildren(),
|
|
21800
|
-
sortedChildren = _toConsumableArray(children);
|
|
21801
|
-
sortedChildren.sort(function (a, b) {
|
|
21802
|
-
var _a, _b, _c, _d;
|
|
21803
|
-
var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21804
|
-
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21805
|
-
for (; angle1 < 0;) angle1 += pi2;
|
|
21806
|
-
for (; angle2 < 0;) angle2 += pi2;
|
|
21807
|
-
return angle2 - angle1;
|
|
21808
|
-
}), sortedChildren.forEach(function (c) {
|
|
21809
|
-
c._next = null, c._prev = null;
|
|
21810
|
-
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
21811
|
-
graphic.appendChild(c);
|
|
21812
|
-
});
|
|
21813
|
-
var _m2 = graphic.parent.globalTransMatrix;
|
|
21814
|
-
drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
|
|
21815
|
-
c._next = null, c._prev = null;
|
|
21816
|
-
}), children.forEach(function (c) {
|
|
21817
|
-
graphic.appendChild(c);
|
|
21818
|
-
});
|
|
21819
|
-
} else if (is3d) {
|
|
21820
|
-
var _children = graphic.getChildren(),
|
|
21821
|
-
zChildren = _children.map(function (g) {
|
|
21822
|
-
return {
|
|
21823
|
-
ave_z: g.findFace().vertices.map(function (v) {
|
|
21824
|
-
var _a;
|
|
21825
|
-
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21826
|
-
}).reduce(function (a, b) {
|
|
21827
|
-
return a + b;
|
|
21828
|
-
}, 0),
|
|
21829
|
-
g: g
|
|
21830
|
-
};
|
|
21831
|
-
});
|
|
21832
|
-
zChildren.sort(function (a, b) {
|
|
21833
|
-
return b.ave_z - a.ave_z;
|
|
21834
|
-
}), graphic.removeAllChild(), zChildren.forEach(function (i) {
|
|
21835
|
-
i.g._next = null, i.g._prev = null;
|
|
21836
|
-
}), graphic.update(), zChildren.forEach(function (i) {
|
|
21837
|
-
graphic.add(i.g);
|
|
21838
|
-
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
21839
|
-
g._next = null, g._prev = null;
|
|
21840
|
-
}), graphic.update(), _children.forEach(function (g) {
|
|
21841
|
-
graphic.add(g);
|
|
21842
|
-
});
|
|
21843
|
-
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21844
|
-
} else drawContribution.renderItem(graphic, drawContext);
|
|
21845
|
-
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21846
|
-
}
|
|
21847
|
-
}, {
|
|
21848
|
-
key: "initCanvasCtx",
|
|
21849
|
-
value: function initCanvasCtx(context) {
|
|
21850
|
-
context.setTransformForCurrent();
|
|
21851
|
-
}
|
|
21852
|
-
}]);
|
|
21853
|
-
return Canvas3DDrawItemInterceptor;
|
|
21854
|
-
}();
|
|
21855
|
-
|
|
21856
|
-
var DefaultBoundsAllocate = /*#__PURE__*/function () {
|
|
21857
|
-
function DefaultBoundsAllocate() {
|
|
21858
|
-
_classCallCheck(this, DefaultBoundsAllocate);
|
|
21859
|
-
this.pools = [];
|
|
21860
|
-
for (var i = 0; i < 10; i++) this.pools.push(new AABBBounds());
|
|
21861
|
-
}
|
|
21862
|
-
_createClass(DefaultBoundsAllocate, [{
|
|
21863
|
-
key: "allocate",
|
|
21864
|
-
value: function allocate(x1, y1, x2, y2) {
|
|
21865
|
-
if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
|
|
21866
|
-
var b = this.pools.pop();
|
|
21867
|
-
return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
|
|
21868
|
-
}
|
|
21869
|
-
}, {
|
|
21870
|
-
key: "allocateByObj",
|
|
21871
|
-
value: function allocateByObj(b) {
|
|
21872
|
-
if (!this.pools.length) return new AABBBounds(b);
|
|
21873
|
-
var _b = this.pools.pop();
|
|
21874
|
-
return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
|
|
21875
|
-
}
|
|
21876
|
-
}, {
|
|
21877
|
-
key: "free",
|
|
21878
|
-
value: function free(b) {
|
|
21879
|
-
this.pools.push(b);
|
|
21880
|
-
}
|
|
21881
|
-
}, {
|
|
21882
|
-
key: "length",
|
|
21883
|
-
get: function get() {
|
|
21884
|
-
return this.pools.length;
|
|
21885
|
-
}
|
|
21886
|
-
}, {
|
|
21887
|
-
key: "release",
|
|
21888
|
-
value: function release() {
|
|
21889
|
-
this.pools = [];
|
|
22172
|
+
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
22173
|
+
return __awaiter$2(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
22174
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
22175
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22176
|
+
case 0:
|
|
22177
|
+
_context.next = 2;
|
|
22178
|
+
return graphic.forEachChildrenAsync(cb, reverse);
|
|
22179
|
+
case 2:
|
|
22180
|
+
case "end":
|
|
22181
|
+
return _context.stop();
|
|
22182
|
+
}
|
|
22183
|
+
}, _callee);
|
|
22184
|
+
}));
|
|
22185
|
+
}
|
|
22186
|
+
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
22187
|
+
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
22188
|
+
var childMap = {},
|
|
22189
|
+
zIdxArray = [];
|
|
22190
|
+
var needSort = !1;
|
|
22191
|
+
graphic.forEachChildren(function (item, i) {
|
|
22192
|
+
var _item$attribute$zInde3 = item.attribute.zIndex,
|
|
22193
|
+
zIndex = _item$attribute$zInde3 === void 0 ? defaultZIndex : _item$attribute$zInde3;
|
|
22194
|
+
if (0 === i) ;else if (undefined !== zIndex) return needSort = !0, !0;
|
|
22195
|
+
return !1;
|
|
22196
|
+
}, reverse);
|
|
22197
|
+
var result = null,
|
|
22198
|
+
next = !1;
|
|
22199
|
+
if (needSort) {
|
|
22200
|
+
graphic.forEachChildren(function (item) {
|
|
22201
|
+
var _item$attribute$zInde4 = item.attribute.zIndex,
|
|
22202
|
+
zIndex = _item$attribute$zInde4 === void 0 ? defaultZIndex : _item$attribute$zInde4;
|
|
22203
|
+
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
|
|
22204
|
+
}, reverse), zIdxArray.sort(function (a, b) {
|
|
22205
|
+
return reverse ? b - a : a - b;
|
|
22206
|
+
});
|
|
22207
|
+
var skip = !1;
|
|
22208
|
+
for (var i = 0; i < zIdxArray.length && !skip; i++) {
|
|
22209
|
+
var idx = zIdxArray[i],
|
|
22210
|
+
children = childMap[idx];
|
|
22211
|
+
for (var _i2 = 0; _i2 < children.length; _i2++) {
|
|
22212
|
+
if (next) {
|
|
22213
|
+
skip = !0, result = children[_i2];
|
|
22214
|
+
break;
|
|
22215
|
+
}
|
|
22216
|
+
children[_i2]._uid !== id || (next = !0);
|
|
22217
|
+
}
|
|
21890
22218
|
}
|
|
21891
|
-
}
|
|
21892
|
-
|
|
21893
|
-
|
|
21894
|
-
|
|
22219
|
+
} else graphic.forEachChildren(function (item) {
|
|
22220
|
+
return next ? (result = item, !0) : (item._uid === id && (next = !0), !1);
|
|
22221
|
+
}, reverse);
|
|
22222
|
+
return result;
|
|
22223
|
+
}
|
|
21895
22224
|
|
|
21896
22225
|
var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21897
22226
|
var d,
|
|
@@ -21945,20 +22274,26 @@
|
|
|
21945
22274
|
width = drawContext.width,
|
|
21946
22275
|
height = drawContext.height;
|
|
21947
22276
|
if (!context) return;
|
|
22277
|
+
if (drawContext.keepMatrix) {
|
|
22278
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
22279
|
+
var t = context.nativeContext.getTransform();
|
|
22280
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
22281
|
+
}
|
|
22282
|
+
} else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
21948
22283
|
var dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
|
|
21949
22284
|
if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
|
|
21950
22285
|
var b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
|
|
21951
22286
|
dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
|
|
21952
22287
|
}
|
|
21953
22288
|
var d = context.dpr % 1;
|
|
21954
|
-
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds)
|
|
22289
|
+
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds);
|
|
21955
22290
|
var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
21956
22291
|
context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
|
|
21957
22292
|
var _a, _b;
|
|
21958
22293
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
21959
22294
|
}).forEach(function (group) {
|
|
21960
22295
|
group.isContainer ? _this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : _this2.renderItem(group, drawContext);
|
|
21961
|
-
}), context.restore(), context.restore(), context.draw(), context.inuse = !1;
|
|
22296
|
+
}), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
|
|
21962
22297
|
}
|
|
21963
22298
|
}, {
|
|
21964
22299
|
key: "doRegister",
|
|
@@ -22091,7 +22426,7 @@
|
|
|
22091
22426
|
}, {
|
|
22092
22427
|
key: "clearScreen",
|
|
22093
22428
|
value: function clearScreen(renderService, context, drawContext) {
|
|
22094
|
-
var _a;
|
|
22429
|
+
var _a, _b;
|
|
22095
22430
|
var clear = drawContext.clear;
|
|
22096
22431
|
if (clear) {
|
|
22097
22432
|
var canvas = context.getCanvas(),
|
|
@@ -22103,7 +22438,7 @@
|
|
|
22103
22438
|
y = 0;
|
|
22104
22439
|
context.clearRect(x, y, width, height);
|
|
22105
22440
|
var stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
|
|
22106
|
-
if (stage && stage.backgroundImg && stage.resources) {
|
|
22441
|
+
if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
|
|
22107
22442
|
var res = stage.resources.get(clear);
|
|
22108
22443
|
res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
|
|
22109
22444
|
} else context.fillStyle = createColor(context, clear, {
|
|
@@ -22413,20 +22748,15 @@
|
|
|
22413
22748
|
_classCallCheck(this, DefaultIncrementalDrawContribution);
|
|
22414
22749
|
_this = _super.call(this, contributions, drawItemInterceptorContributions), _this.contributions = contributions, _this.lineRender = lineRender, _this.areaRender = areaRender, _this.drawItemInterceptorContributions = drawItemInterceptorContributions, _this.rendering = !1, _this.currFrameStartAt = 0, _this.currentIdx = 0, _this.status = STATUS.NORMAL, _this.checkingForDrawPromise = null, _this.hooks = {
|
|
22415
22750
|
completeDraw: new SyncHook([])
|
|
22416
|
-
};
|
|
22751
|
+
}, _this.defaultRenderMap.set(_this.lineRender.numberType, _this.lineRender), _this.defaultRenderMap.set(_this.areaRender.numberType, _this.areaRender);
|
|
22417
22752
|
return _this;
|
|
22418
22753
|
}
|
|
22419
22754
|
_createClass(DefaultIncrementalDrawContribution, [{
|
|
22420
|
-
key: "init",
|
|
22421
|
-
value: function init() {
|
|
22422
|
-
_get(_getPrototypeOf(DefaultIncrementalDrawContribution.prototype), "init", this).call(this), this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender), this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
|
|
22423
|
-
}
|
|
22424
|
-
}, {
|
|
22425
22755
|
key: "draw",
|
|
22426
22756
|
value: function draw(renderService, drawContext) {
|
|
22427
22757
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
22428
22758
|
var _this2 = this;
|
|
22429
|
-
var skipDraw, context, _drawContext$x, x, _drawContext$y, y;
|
|
22759
|
+
var skipDraw, context, _drawContext$x, x, _drawContext$y, y, t;
|
|
22430
22760
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
22431
22761
|
while (1) switch (_context.prev = _context.next) {
|
|
22432
22762
|
case 0:
|
|
@@ -22449,14 +22779,22 @@
|
|
|
22449
22779
|
case 8:
|
|
22450
22780
|
this.currentRenderService = renderService;
|
|
22451
22781
|
context = drawContext.context, _drawContext$x = drawContext.x, x = _drawContext$x === void 0 ? 0 : _drawContext$x, _drawContext$y = drawContext.y, y = _drawContext$y === void 0 ? 0 : _drawContext$y;
|
|
22452
|
-
|
|
22453
|
-
|
|
22454
|
-
|
|
22455
|
-
|
|
22456
|
-
|
|
22457
|
-
|
|
22458
|
-
|
|
22459
|
-
|
|
22782
|
+
if (context) {
|
|
22783
|
+
if (drawContext.keepMatrix) {
|
|
22784
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
22785
|
+
t = context.nativeContext.getTransform();
|
|
22786
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
22787
|
+
}
|
|
22788
|
+
} else context.inuse = !0, context.clearMatrix();
|
|
22789
|
+
context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
|
|
22790
|
+
var _a, _b;
|
|
22791
|
+
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22792
|
+
}).forEach(function (group) {
|
|
22793
|
+
_this2.renderGroup(group, drawContext);
|
|
22794
|
+
}), this.hooks.completeDraw.tap("top-draw", function () {
|
|
22795
|
+
context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), _this2.rendering = !1;
|
|
22796
|
+
});
|
|
22797
|
+
}
|
|
22460
22798
|
case 11:
|
|
22461
22799
|
case "end":
|
|
22462
22800
|
return _context.stop();
|
|
@@ -22731,18 +23069,17 @@
|
|
|
22731
23069
|
DefaultIncrementalDrawContribution = __decorate$18([injectable(), __param$A(0, multiInject(GraphicRender)), __param$A(1, inject(DefaultIncrementalCanvasLineRender)), __param$A(2, inject(DefaultIncrementalCanvasAreaRender)), __param$A(3, inject(ContributionProvider)), __param$A(3, named(DrawItemInterceptor)), __metadata$T("design:paramtypes", [Array, Object, Object, Object])], DefaultIncrementalDrawContribution);
|
|
22732
23070
|
|
|
22733
23071
|
var renderModule = new ContainerModule(function (bind) {
|
|
22734
|
-
bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
|
|
23072
|
+
bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(exports.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(exports.CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
|
|
22735
23073
|
});
|
|
22736
23074
|
|
|
22737
23075
|
function load(container) {
|
|
22738
23076
|
container.load(renderModule);
|
|
22739
23077
|
}
|
|
22740
23078
|
|
|
22741
|
-
var loaded$r = !1;
|
|
22742
23079
|
function preLoadAllModule() {
|
|
22743
|
-
|
|
23080
|
+
preLoadAllModule.__loaded || (preLoadAllModule.__loaded = !0, container.load(coreModule), container.load(graphicModule), container.load(renderModule$1), container.load(pickModule), container.load(pluginModule), load$1(container), load(container));
|
|
22744
23081
|
}
|
|
22745
|
-
preLoadAllModule();
|
|
23082
|
+
preLoadAllModule.__loaded = !1, preLoadAllModule();
|
|
22746
23083
|
var vglobal = container.get(VGlobal);
|
|
22747
23084
|
application.global = vglobal;
|
|
22748
23085
|
var graphicUtil = container.get(GraphicUtil);
|
|
@@ -22892,6 +23229,8 @@
|
|
|
22892
23229
|
var _this = this;
|
|
22893
23230
|
this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, function (stage) {
|
|
22894
23231
|
stage && stage === _this.pluginService.stage && _this.drawHTML(context.stage.renderService);
|
|
23232
|
+
}), application.graphicService.hooks.onRemove.tap(this.key, function (graphic) {
|
|
23233
|
+
_this.removeDom(graphic);
|
|
22895
23234
|
}), application.graphicService.hooks.onRelease.tap(this.key, function (graphic) {
|
|
22896
23235
|
_this.removeDom(graphic);
|
|
22897
23236
|
});
|
|
@@ -22948,35 +23287,34 @@
|
|
|
22948
23287
|
anchorType = _html$anchorType === void 0 ? "boundsLeftTop" : _html$anchorType;
|
|
22949
23288
|
graphic.bindDom || (graphic.bindDom = new Map());
|
|
22950
23289
|
var lastDom = graphic.bindDom.get(dom);
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
22967
|
-
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
}
|
|
23290
|
+
var wrapGroup, nativeContainer;
|
|
23291
|
+
if (!lastDom || container && container !== lastDom.container) {
|
|
23292
|
+
var nativeDom;
|
|
23293
|
+
graphic.bindDom.forEach(function (_ref) {
|
|
23294
|
+
var wrapGroup = _ref.wrapGroup;
|
|
23295
|
+
application.global.removeDom(wrapGroup);
|
|
23296
|
+
}), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
|
|
23297
|
+
var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
|
|
23298
|
+
nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
|
|
23299
|
+
tagName: "div",
|
|
23300
|
+
width: width,
|
|
23301
|
+
height: height,
|
|
23302
|
+
style: style,
|
|
23303
|
+
parent: nativeContainer
|
|
23304
|
+
}), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
|
|
23305
|
+
dom: nativeDom,
|
|
23306
|
+
container: container,
|
|
23307
|
+
wrapGroup: wrapGroup
|
|
23308
|
+
}));
|
|
23309
|
+
} else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
|
|
23310
|
+
wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
|
|
22971
23311
|
var left = 0,
|
|
22972
23312
|
top = 0;
|
|
22973
|
-
|
|
22974
|
-
|
|
23313
|
+
var b = graphic.globalAABBBounds;
|
|
23314
|
+
if ("position" === anchorType || b.empty()) {
|
|
23315
|
+
var matrix = graphic.globalTransMatrix;
|
|
22975
23316
|
left = matrix.e, top = matrix.f;
|
|
22976
|
-
} else
|
|
22977
|
-
var b = graphic.AABBBounds;
|
|
22978
|
-
left = b.x1, top = b.y1;
|
|
22979
|
-
}
|
|
23317
|
+
} else left = b.x1, top = b.y1;
|
|
22980
23318
|
var containerTL = application.global.getElementTopLeft(nativeContainer, !1),
|
|
22981
23319
|
windowTL = stage.window.getTopLeft(!1),
|
|
22982
23320
|
offsetX = left + windowTL.left - containerTL.left,
|
|
@@ -23033,13 +23371,23 @@
|
|
|
23033
23371
|
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
23034
23372
|
}
|
|
23035
23373
|
_createClass(FlexLayoutPlugin, [{
|
|
23374
|
+
key: "pauseLayout",
|
|
23375
|
+
value: function pauseLayout(p) {
|
|
23376
|
+
this.pause = p;
|
|
23377
|
+
}
|
|
23378
|
+
}, {
|
|
23379
|
+
key: "tryLayoutChildren",
|
|
23380
|
+
value: function tryLayoutChildren(graphic) {
|
|
23381
|
+
graphic.firstChild && this.tryLayout(graphic.firstChild);
|
|
23382
|
+
}
|
|
23383
|
+
}, {
|
|
23036
23384
|
key: "tryLayout",
|
|
23037
23385
|
value: function tryLayout(graphic) {
|
|
23038
23386
|
var _this = this;
|
|
23039
|
-
|
|
23040
|
-
this.
|
|
23387
|
+
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
23388
|
+
if (this.pause) return;
|
|
23041
23389
|
var p = graphic.parent;
|
|
23042
|
-
if (!
|
|
23390
|
+
if (!(force || p && graphic.needUpdateLayout())) return;
|
|
23043
23391
|
var theme = getTheme(p).group,
|
|
23044
23392
|
_p$attribute$display = p.attribute.display,
|
|
23045
23393
|
display = _p$attribute$display === void 0 ? theme.display : _p$attribute$display;
|
|
@@ -23049,24 +23397,29 @@
|
|
|
23049
23397
|
flexDirection = _p$attribute$flexDire === void 0 ? theme.flexDirection : _p$attribute$flexDire,
|
|
23050
23398
|
_p$attribute$flexWrap = _p$attribute.flexWrap,
|
|
23051
23399
|
flexWrap = _p$attribute$flexWrap === void 0 ? theme.flexWrap : _p$attribute$flexWrap,
|
|
23052
|
-
_p$attribute$justifyC = _p$attribute.justifyContent,
|
|
23053
|
-
justifyContent = _p$attribute$justifyC === void 0 ? theme.justifyContent : _p$attribute$justifyC,
|
|
23054
23400
|
_p$attribute$alignIte = _p$attribute.alignItems,
|
|
23055
23401
|
alignItems = _p$attribute$alignIte === void 0 ? theme.alignItems : _p$attribute$alignIte,
|
|
23056
|
-
_p$attribute$alignCon = _p$attribute.alignContent,
|
|
23057
|
-
alignContent = _p$attribute$alignCon === void 0 ? theme.alignContent : _p$attribute$alignCon,
|
|
23058
23402
|
_p$attribute$clip = _p$attribute.clip,
|
|
23059
|
-
clip = _p$attribute$clip === void 0 ? theme.clip : _p$attribute$clip
|
|
23060
|
-
|
|
23061
|
-
|
|
23062
|
-
|
|
23063
|
-
|
|
23064
|
-
|
|
23065
|
-
|
|
23066
|
-
|
|
23067
|
-
var
|
|
23068
|
-
|
|
23069
|
-
|
|
23403
|
+
clip = _p$attribute$clip === void 0 ? theme.clip : _p$attribute$clip,
|
|
23404
|
+
_p$attribute$alignCon = p.attribute.alignContent,
|
|
23405
|
+
alignContent = _p$attribute$alignCon === void 0 ? null != alignItems ? alignItems : theme.alignContent : _p$attribute$alignCon;
|
|
23406
|
+
var _p$attribute2 = p.attribute,
|
|
23407
|
+
width = _p$attribute2.width,
|
|
23408
|
+
height = _p$attribute2.height,
|
|
23409
|
+
_p$attribute2$justify = _p$attribute2.justifyContent,
|
|
23410
|
+
justifyContent = _p$attribute2$justify === void 0 ? theme.justifyContent : _p$attribute2$justify;
|
|
23411
|
+
var children = p.getChildren();
|
|
23412
|
+
if (null == width || null == height) {
|
|
23413
|
+
var childrenWidth = 0,
|
|
23414
|
+
childrenHeight = 0,
|
|
23415
|
+
boundsLegal = 0;
|
|
23416
|
+
if (children.forEach(function (child) {
|
|
23417
|
+
var bounds = _this.getAABBBounds(child);
|
|
23418
|
+
bounds.empty() || ("column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2);
|
|
23419
|
+
}), !isFinite(boundsLegal)) return;
|
|
23420
|
+
width = childrenWidth, height = childrenHeight;
|
|
23421
|
+
}
|
|
23422
|
+
p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
|
|
23070
23423
|
var result = {
|
|
23071
23424
|
main: {
|
|
23072
23425
|
len: width,
|
|
@@ -23075,18 +23428,18 @@
|
|
|
23075
23428
|
cross: {
|
|
23076
23429
|
len: height,
|
|
23077
23430
|
field: "y"
|
|
23078
|
-
}
|
|
23079
|
-
dir: 1
|
|
23431
|
+
}
|
|
23080
23432
|
},
|
|
23081
23433
|
main = result.main,
|
|
23082
23434
|
cross = result.cross;
|
|
23083
|
-
"
|
|
23435
|
+
"column" !== flexDirection && "column-reverse" !== flexDirection || (main.len = height, cross.len = width, main.field = "y", cross.field = "x"), "row-reverse" !== flexDirection && "column-reverse" !== flexDirection || ("flex-start" === justifyContent ? justifyContent = "flex-end" : "flex-end" === justifyContent ? justifyContent = "flex-start" : children.reverse());
|
|
23084
23436
|
var mainLen = 0,
|
|
23085
23437
|
crossLen = 0;
|
|
23086
23438
|
var mianLenArray = [];
|
|
23087
|
-
|
|
23088
|
-
var b = c
|
|
23089
|
-
|
|
23439
|
+
children.forEach(function (c) {
|
|
23440
|
+
var b = _this.getAABBBounds(c);
|
|
23441
|
+
if (b.empty()) return;
|
|
23442
|
+
var ml = "x" === main.field ? b.width() : b.height(),
|
|
23090
23443
|
cl = "x" === cross.field ? b.width() : b.height();
|
|
23091
23444
|
mianLenArray.push({
|
|
23092
23445
|
mainLen: ml,
|
|
@@ -23119,104 +23472,171 @@
|
|
|
23119
23472
|
mainLen: mainLen,
|
|
23120
23473
|
crossLen: crossLen
|
|
23121
23474
|
});
|
|
23122
|
-
var children = p.getChildren();
|
|
23123
23475
|
var lastIdx = 0;
|
|
23124
23476
|
if (mainList.forEach(function (s) {
|
|
23125
23477
|
_this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s), lastIdx = s.idx + 1;
|
|
23126
23478
|
}), crossLen = mainList.reduce(function (a, b) {
|
|
23127
23479
|
return a + b.crossLen;
|
|
23128
23480
|
}, 0), 1 === mainList.length) {
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23135
|
-
} else children.forEach(function (child) {
|
|
23136
|
-
child.attribute[cross.field] = getPadding(child, cross.field);
|
|
23137
|
-
});
|
|
23481
|
+
var anchorPosMap = {
|
|
23482
|
+
"flex-start": 0,
|
|
23483
|
+
"flex-end": cross.len,
|
|
23484
|
+
center: cross.len / 2
|
|
23485
|
+
};
|
|
23486
|
+
this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);
|
|
23138
23487
|
} else if ("flex-start" === alignContent) {
|
|
23139
23488
|
lastIdx = 0;
|
|
23140
|
-
var
|
|
23489
|
+
var anchorPos = 0;
|
|
23141
23490
|
mainList.forEach(function (s, i) {
|
|
23142
|
-
|
|
23491
|
+
var anchorPosMap = {
|
|
23492
|
+
"flex-start": anchorPos,
|
|
23493
|
+
"flex-end": anchorPos + s.crossLen,
|
|
23494
|
+
center: anchorPos + s.crossLen / 2
|
|
23495
|
+
};
|
|
23496
|
+
_this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
|
|
23143
23497
|
});
|
|
23144
23498
|
} else if ("center" === alignContent) {
|
|
23145
23499
|
lastIdx = 0;
|
|
23146
|
-
var
|
|
23500
|
+
var _anchorPos = Math.max(0, (cross.len - crossLen) / 2);
|
|
23147
23501
|
mainList.forEach(function (s, i) {
|
|
23148
|
-
|
|
23502
|
+
var anchorPosMap = {
|
|
23503
|
+
"flex-start": _anchorPos,
|
|
23504
|
+
"flex-end": _anchorPos + s.crossLen,
|
|
23505
|
+
center: _anchorPos + s.crossLen / 2
|
|
23506
|
+
};
|
|
23507
|
+
_this.layoutCross(children, "center", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos += s.crossLen;
|
|
23149
23508
|
});
|
|
23150
23509
|
} else if ("space-around" === alignContent) {
|
|
23151
23510
|
lastIdx = 0;
|
|
23152
23511
|
var padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);
|
|
23153
|
-
var
|
|
23512
|
+
var _anchorPos2 = padding;
|
|
23154
23513
|
mainList.forEach(function (s, i) {
|
|
23155
|
-
|
|
23514
|
+
var anchorPosMap = {
|
|
23515
|
+
"flex-start": _anchorPos2,
|
|
23516
|
+
"flex-end": _anchorPos2 + s.crossLen,
|
|
23517
|
+
center: _anchorPos2 + s.crossLen / 2
|
|
23518
|
+
};
|
|
23519
|
+
_this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos2 += s.crossLen + 2 * padding;
|
|
23156
23520
|
});
|
|
23157
23521
|
} else if ("space-between" === alignContent) {
|
|
23158
23522
|
lastIdx = 0;
|
|
23159
23523
|
var _padding = Math.max(0, (cross.len - crossLen) / (2 * mainList.length - 2));
|
|
23160
|
-
var
|
|
23524
|
+
var _anchorPos3 = 0;
|
|
23161
23525
|
mainList.forEach(function (s, i) {
|
|
23162
|
-
|
|
23526
|
+
var anchorPosMap = {
|
|
23527
|
+
"flex-start": _anchorPos3,
|
|
23528
|
+
"flex-end": _anchorPos3 + s.crossLen,
|
|
23529
|
+
center: _anchorPos3 + s.crossLen / 2
|
|
23530
|
+
};
|
|
23531
|
+
_this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos3 += s.crossLen + 2 * _padding;
|
|
23163
23532
|
});
|
|
23164
23533
|
}
|
|
23165
23534
|
children.forEach(function (child, idx) {
|
|
23166
23535
|
child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
|
|
23167
|
-
}), p.addUpdateLayoutTag()
|
|
23536
|
+
}), p.addUpdateLayoutTag();
|
|
23537
|
+
var b = this.getAABBBounds(p);
|
|
23538
|
+
clip || this.tempBounds.equals(b) || this.tryLayout(p, !1);
|
|
23539
|
+
}
|
|
23540
|
+
}, {
|
|
23541
|
+
key: "getAABBBounds",
|
|
23542
|
+
value: function getAABBBounds(graphic) {
|
|
23543
|
+
this.skipBoundsTrigger = !0;
|
|
23544
|
+
var b = graphic.AABBBounds;
|
|
23545
|
+
return this.skipBoundsTrigger = !1, b;
|
|
23546
|
+
}
|
|
23547
|
+
}, {
|
|
23548
|
+
key: "updateChildPos",
|
|
23549
|
+
value: function updateChildPos(posBaseLeftTop, lastP, lastBP) {
|
|
23550
|
+
return posBaseLeftTop + (null != lastP ? lastP : 0) - lastBP;
|
|
23168
23551
|
}
|
|
23169
23552
|
}, {
|
|
23170
23553
|
key: "layoutMain",
|
|
23171
23554
|
value: function layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
|
|
23172
23555
|
if ("flex-start" === justifyContent) {
|
|
23173
23556
|
var pos = 0;
|
|
23174
|
-
for (var i = lastIdx; i <= currSeg.idx; i++)
|
|
23557
|
+
for (var i = lastIdx; i <= currSeg.idx; i++) {
|
|
23558
|
+
var posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
23559
|
+
b = this.getAABBBounds(children[i]);
|
|
23560
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b["".concat(main.field, "1")])), pos += mianLenArray[i].mainLen;
|
|
23561
|
+
}
|
|
23175
23562
|
} else if ("flex-end" === justifyContent) {
|
|
23176
23563
|
var _pos = main.len;
|
|
23177
|
-
for (var _i = lastIdx; _i <= currSeg.idx; _i++)
|
|
23564
|
+
for (var _i = lastIdx; _i <= currSeg.idx; _i++) {
|
|
23565
|
+
_pos -= mianLenArray[_i].mainLen;
|
|
23566
|
+
var _posBaseLeftTop = _pos + getPadding(children[_i], main.field),
|
|
23567
|
+
_b = this.getAABBBounds(children[_i]);
|
|
23568
|
+
!_b.empty() && (children[_i].attribute[main.field] = this.updateChildPos(_posBaseLeftTop, children[_i].attribute[main.field], _b["".concat(main.field, "1")]));
|
|
23569
|
+
}
|
|
23178
23570
|
} else if ("space-around" === justifyContent) {
|
|
23179
23571
|
if (currSeg.mainLen >= main.len) {
|
|
23180
23572
|
var _pos2 = 0;
|
|
23181
|
-
for (var _i2 = lastIdx; _i2 <= currSeg.idx; _i2++)
|
|
23573
|
+
for (var _i2 = lastIdx; _i2 <= currSeg.idx; _i2++) {
|
|
23574
|
+
var _posBaseLeftTop2 = _pos2 + getPadding(children[_i2], main.field),
|
|
23575
|
+
_b2 = this.getAABBBounds(children[_i2]);
|
|
23576
|
+
!_b2.empty() && (children[_i2].attribute[main.field] = this.updateChildPos(_posBaseLeftTop2, children[_i2].attribute[main.field], _b2["".concat(main.field, "1")])), _pos2 += mianLenArray[_i2].mainLen;
|
|
23577
|
+
}
|
|
23182
23578
|
} else {
|
|
23183
23579
|
var size = currSeg.idx - lastIdx + 1,
|
|
23184
23580
|
padding = (main.len - currSeg.mainLen) / size / 2;
|
|
23185
23581
|
var _pos3 = padding;
|
|
23186
|
-
for (var _i3 = lastIdx; _i3 <= currSeg.idx; _i3++)
|
|
23582
|
+
for (var _i3 = lastIdx; _i3 <= currSeg.idx; _i3++) {
|
|
23583
|
+
var _posBaseLeftTop3 = _pos3 + getPadding(children[_i3], main.field),
|
|
23584
|
+
_b3 = this.getAABBBounds(children[_i3]);
|
|
23585
|
+
!_b3.empty() && (children[_i3].attribute[main.field] = this.updateChildPos(_posBaseLeftTop3, children[_i3].attribute[main.field], _b3["".concat(main.field, "1")])), _pos3 += mianLenArray[_i3].mainLen + 2 * padding;
|
|
23586
|
+
}
|
|
23187
23587
|
}
|
|
23188
23588
|
} else if ("space-between" === justifyContent) {
|
|
23189
23589
|
if (currSeg.mainLen >= main.len) {
|
|
23190
23590
|
var _pos4 = 0;
|
|
23191
|
-
for (var _i4 = lastIdx; _i4 <= currSeg.idx; _i4++)
|
|
23591
|
+
for (var _i4 = lastIdx; _i4 <= currSeg.idx; _i4++) {
|
|
23592
|
+
var _posBaseLeftTop4 = _pos4 + getPadding(children[_i4], main.field),
|
|
23593
|
+
_b4 = this.getAABBBounds(children[_i4]);
|
|
23594
|
+
!_b4.empty() && (children[_i4].attribute[main.field] = this.updateChildPos(_posBaseLeftTop4, children[_i4].attribute[main.field], _b4["".concat(main.field, "1")])), _pos4 += mianLenArray[_i4].mainLen;
|
|
23595
|
+
}
|
|
23192
23596
|
} else {
|
|
23193
23597
|
var _size = currSeg.idx - lastIdx + 1,
|
|
23194
23598
|
_padding2 = (main.len - currSeg.mainLen) / (2 * _size - 2);
|
|
23195
23599
|
var _pos5 = 0;
|
|
23196
|
-
for (var _i5 = lastIdx; _i5 <= currSeg.idx; _i5++)
|
|
23600
|
+
for (var _i5 = lastIdx; _i5 <= currSeg.idx; _i5++) {
|
|
23601
|
+
var _posBaseLeftTop5 = _pos5 + getPadding(children[_i5], main.field),
|
|
23602
|
+
_b5 = this.getAABBBounds(children[_i5]);
|
|
23603
|
+
!_b5.empty() && (children[_i5].attribute[main.field] = this.updateChildPos(_posBaseLeftTop5, children[_i5].attribute[main.field], _b5["".concat(main.field, "1")])), _pos5 += mianLenArray[_i5].mainLen + 2 * _padding2;
|
|
23604
|
+
}
|
|
23197
23605
|
}
|
|
23198
23606
|
} else if ("center" === justifyContent) {
|
|
23199
23607
|
var _pos6 = (main.len - currSeg.mainLen) / 2;
|
|
23200
|
-
for (var _i6 = lastIdx; _i6 <= currSeg.idx; _i6++)
|
|
23608
|
+
for (var _i6 = lastIdx; _i6 <= currSeg.idx; _i6++) {
|
|
23609
|
+
var _posBaseLeftTop6 = _pos6 + getPadding(children[_i6], main.field),
|
|
23610
|
+
_b6 = this.getAABBBounds(children[_i6]);
|
|
23611
|
+
!_b6.empty() && (children[_i6].attribute[main.field] = this.updateChildPos(_posBaseLeftTop6, children[_i6].attribute[main.field], _b6["".concat(main.field, "1")])), _pos6 += mianLenArray[_i6].mainLen;
|
|
23612
|
+
}
|
|
23201
23613
|
}
|
|
23202
23614
|
}
|
|
23203
23615
|
}, {
|
|
23204
23616
|
key: "layoutCross",
|
|
23205
|
-
value: function layoutCross(children, alignItem, cross,
|
|
23206
|
-
|
|
23617
|
+
value: function layoutCross(children, alignItem, cross, anchorPosMap, lenArray, currSeg, lastIdx) {
|
|
23618
|
+
var _a;
|
|
23619
|
+
for (var i = lastIdx; i <= currSeg.idx; i++) {
|
|
23620
|
+
var child = children[i];
|
|
23621
|
+
var alignSelf = child.attribute.alignSelf;
|
|
23622
|
+
alignSelf && "auto" !== alignSelf || (alignSelf = alignItem);
|
|
23623
|
+
var b = this.getAABBBounds(child),
|
|
23624
|
+
anchorPos = null !== (_a = anchorPosMap[alignSelf]) && void 0 !== _a ? _a : anchorPosMap["flex-start"];
|
|
23625
|
+
"flex-end" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")])) : "center" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")])) : !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")]));
|
|
23626
|
+
}
|
|
23207
23627
|
}
|
|
23208
23628
|
}, {
|
|
23209
23629
|
key: "activate",
|
|
23210
23630
|
value: function activate(context) {
|
|
23211
23631
|
var _this2 = this;
|
|
23212
23632
|
this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, function (graphic) {
|
|
23213
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic
|
|
23633
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === _this2.pluginService.stage && _this2.tryLayout(graphic, !1);
|
|
23214
23634
|
}), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, function (graphic, stage, willUpdate, bounds) {
|
|
23215
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage && graphic.isContainer && _tempBounds.copy(bounds);
|
|
23635
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage && graphic.isContainer && !_this2.skipBoundsTrigger && _tempBounds.copy(bounds);
|
|
23216
23636
|
}), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, function (graphic, stage, bounds, params, selfChange) {
|
|
23217
|
-
stage && stage === _this2.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) ||
|
|
23637
|
+
stage && stage === _this2.pluginService.stage && graphic.isContainer && !_this2.skipBoundsTrigger && (_tempBounds.equals(bounds) || _this2.tryLayout(graphic, !1));
|
|
23218
23638
|
}), application.graphicService.hooks.onSetStage.tap(this.key, function (graphic) {
|
|
23219
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic
|
|
23639
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic, !1);
|
|
23220
23640
|
});
|
|
23221
23641
|
}
|
|
23222
23642
|
}, {
|
|
@@ -23225,6 +23645,10 @@
|
|
|
23225
23645
|
var _this3 = this;
|
|
23226
23646
|
application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(function (item) {
|
|
23227
23647
|
return item.name !== _this3.key;
|
|
23648
|
+
}), application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(function (item) {
|
|
23649
|
+
return item.name !== _this3.key;
|
|
23650
|
+
}), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(function (item) {
|
|
23651
|
+
return item.name !== _this3.key;
|
|
23228
23652
|
}), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(function (item) {
|
|
23229
23653
|
return item.name !== _this3.key;
|
|
23230
23654
|
});
|
|
@@ -23233,11 +23657,7 @@
|
|
|
23233
23657
|
return FlexLayoutPlugin;
|
|
23234
23658
|
}();
|
|
23235
23659
|
function getPadding(graphic, field) {
|
|
23236
|
-
|
|
23237
|
-
if (isNumber(graphic.attribute.boundsPadding)) return graphic.attribute.boundsPadding;
|
|
23238
|
-
if (isArray$1(graphic.attribute.boundsPadding) && 1 === graphic.attribute.boundsPadding.length) return graphic.attribute.boundsPadding[0];
|
|
23239
|
-
var paddingArray = parsePadding(graphic.attribute.boundsPadding);
|
|
23240
|
-
return "x" === field ? paddingArray[3] : "y" === field ? paddingArray[0] : 0;
|
|
23660
|
+
return 0;
|
|
23241
23661
|
}
|
|
23242
23662
|
|
|
23243
23663
|
var defaultTicker = new DefaultTicker();
|
|
@@ -23401,24 +23821,21 @@
|
|
|
23401
23821
|
|
|
23402
23822
|
var _isBrowserEnv;
|
|
23403
23823
|
function initIsBrowserEnv() {
|
|
23404
|
-
if (null == _isBrowserEnv) {
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
|
|
23408
|
-
_isBrowserEnv = !1;
|
|
23409
|
-
}
|
|
23410
|
-
if (_isBrowserEnv) try {
|
|
23411
|
-
_isBrowserEnv = !tt;
|
|
23412
|
-
} catch (err) {
|
|
23413
|
-
_isBrowserEnv = !0;
|
|
23414
|
-
}
|
|
23824
|
+
if (null == _isBrowserEnv) try {
|
|
23825
|
+
_isBrowserEnv = globalThis === window, _isBrowserEnv && (_isBrowserEnv = !!document.createElement);
|
|
23826
|
+
} catch (err) {
|
|
23827
|
+
_isBrowserEnv = !1;
|
|
23415
23828
|
}
|
|
23416
23829
|
}
|
|
23417
23830
|
function isBrowserEnv() {
|
|
23418
|
-
|
|
23831
|
+
initIsBrowserEnv();
|
|
23832
|
+
var env = application.global && application.global.env;
|
|
23833
|
+
return env ? "browser" === env : _isBrowserEnv;
|
|
23419
23834
|
}
|
|
23420
23835
|
function isNodeEnv() {
|
|
23421
|
-
|
|
23836
|
+
initIsBrowserEnv();
|
|
23837
|
+
var env = application.global && application.global.env;
|
|
23838
|
+
return env ? "node" === env : !_isBrowserEnv;
|
|
23422
23839
|
}
|
|
23423
23840
|
function getCurrentEnv() {
|
|
23424
23841
|
return isBrowserEnv() ? "browser" : "node";
|
|
@@ -23556,6 +23973,8 @@
|
|
|
23556
23973
|
resolution: this.window.dpr || this.global.devicePixelRatio,
|
|
23557
23974
|
rootNode: this,
|
|
23558
23975
|
global: this.global,
|
|
23976
|
+
supportsPointerEvents: this.params.supportsPointerEvents,
|
|
23977
|
+
supportsTouchEvents: this.params.supportsTouchEvents,
|
|
23559
23978
|
viewport: {
|
|
23560
23979
|
viewBox: this._viewBox,
|
|
23561
23980
|
get x() {
|
|
@@ -23762,6 +24181,11 @@
|
|
|
23762
24181
|
_this7.pluginService.unRegister(plugin);
|
|
23763
24182
|
}));
|
|
23764
24183
|
}
|
|
24184
|
+
}, {
|
|
24185
|
+
key: "getPluginsByName",
|
|
24186
|
+
value: function getPluginsByName(name) {
|
|
24187
|
+
return this.pluginService.findPluginsByName(name);
|
|
24188
|
+
}
|
|
23765
24189
|
}, {
|
|
23766
24190
|
key: "tryUpdateAABBBounds",
|
|
23767
24191
|
value: function tryUpdateAABBBounds() {
|
|
@@ -23800,7 +24224,7 @@
|
|
|
23800
24224
|
}, {
|
|
23801
24225
|
key: "tryInitInteractiveLayer",
|
|
23802
24226
|
value: function tryInitInteractiveLayer() {
|
|
23803
|
-
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
24227
|
+
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
23804
24228
|
}
|
|
23805
24229
|
}, {
|
|
23806
24230
|
key: "clearViewBox",
|
|
@@ -23812,7 +24236,7 @@
|
|
|
23812
24236
|
value: function render(layers, params) {
|
|
23813
24237
|
this.ticker.start(), this.timeline.resume();
|
|
23814
24238
|
var state = this.state;
|
|
23815
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
24239
|
+
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children, params), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
23816
24240
|
}
|
|
23817
24241
|
}, {
|
|
23818
24242
|
key: "combineLayersToWindow",
|
|
@@ -23849,7 +24273,8 @@
|
|
|
23849
24273
|
background: layer === _this10.defaultLayer ? _this10.background : void 0,
|
|
23850
24274
|
updateBounds: !(!_this10.dirtyBounds || _this10.dirtyBounds.empty())
|
|
23851
24275
|
}, Object.assign({
|
|
23852
|
-
renderStyle: _this10.renderStyle
|
|
24276
|
+
renderStyle: _this10.renderStyle,
|
|
24277
|
+
keepMatrix: _this10.params.renderKeepMatrix
|
|
23853
24278
|
}, params)));
|
|
23854
24279
|
}), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
|
|
23855
24280
|
renderService: this.renderService,
|
|
@@ -24751,11 +25176,17 @@
|
|
|
24751
25176
|
if (!params.bounds.contains(point.x, point.y)) return result;
|
|
24752
25177
|
offsetX = params.bounds.x1, offsetY = params.bounds.y1;
|
|
24753
25178
|
}
|
|
24754
|
-
|
|
25179
|
+
if (this.pickContext) if (params.keepMatrix) {
|
|
25180
|
+
if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
|
|
25181
|
+
var t = this.pickContext.nativeContext.getTransform();
|
|
25182
|
+
this.pickContext.setTransformFromMatrix(t, !0, 1);
|
|
25183
|
+
}
|
|
25184
|
+
} else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
|
|
25185
|
+
params.pickContext = this.pickContext;
|
|
24755
25186
|
var parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
|
|
24756
25187
|
var group;
|
|
24757
25188
|
for (var i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
|
|
24758
|
-
if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
|
|
25189
|
+
if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
|
|
24759
25190
|
var g = result.graphic;
|
|
24760
25191
|
for (; g.parent;) g = g.parent;
|
|
24761
25192
|
g.shadowHost && (result.params = {
|
|
@@ -26685,7 +27116,7 @@
|
|
|
26685
27116
|
ops: I(t, e, s, n, a)
|
|
26686
27117
|
};
|
|
26687
27118
|
}
|
|
26688
|
-
function m(t, e, s) {
|
|
27119
|
+
function m$2(t, e, s) {
|
|
26689
27120
|
var n = (t || []).length;
|
|
26690
27121
|
if (n > 2) {
|
|
26691
27122
|
var _a5 = [];
|
|
@@ -26702,7 +27133,7 @@
|
|
|
26702
27133
|
}
|
|
26703
27134
|
function w(t, e, s, n, a) {
|
|
26704
27135
|
return function (t, e) {
|
|
26705
|
-
return m(t, !0, e);
|
|
27136
|
+
return m$2(t, !0, e);
|
|
26706
27137
|
}([[t, e], [t + s, e], [t + s, e + n], [t, e + n]], a);
|
|
26707
27138
|
}
|
|
26708
27139
|
function x(t, e) {
|
|
@@ -27138,7 +27569,7 @@
|
|
|
27138
27569
|
key: "linearPath",
|
|
27139
27570
|
value: function linearPath(t, e) {
|
|
27140
27571
|
var s = this._o(e);
|
|
27141
|
-
return this._d("linearPath", [m(t, !1, s)], s);
|
|
27572
|
+
return this._d("linearPath", [m$2(t, !1, s)], s);
|
|
27142
27573
|
}
|
|
27143
27574
|
}, {
|
|
27144
27575
|
key: "arc",
|
|
@@ -27205,7 +27636,7 @@
|
|
|
27205
27636
|
value: function polygon(t, e) {
|
|
27206
27637
|
var s = this._o(e),
|
|
27207
27638
|
n = [],
|
|
27208
|
-
a = m(t, !0, s);
|
|
27639
|
+
a = m$2(t, !0, s);
|
|
27209
27640
|
return s.fill && ("solid" === s.fillStyle ? n.push(S([t], s)) : n.push(L([t], s))), s.stroke !== H && n.push(a), this._d("polygon", n, s);
|
|
27210
27641
|
}
|
|
27211
27642
|
}, {
|
|
@@ -27271,7 +27702,7 @@
|
|
|
27271
27702
|
return l;
|
|
27272
27703
|
}(t, 1, h ? 4 - 4 * s.simplification : (1 + s.roughness) / 2);
|
|
27273
27704
|
return a && ("solid" === s.fillStyle ? n.push(S(r, s)) : n.push(L(r, s))), o && (h ? r.forEach(function (t) {
|
|
27274
|
-
n.push(m(t, !1, s));
|
|
27705
|
+
n.push(m$2(t, !1, s));
|
|
27275
27706
|
}) : n.push(function (t, e) {
|
|
27276
27707
|
var s = g(d(f(t))),
|
|
27277
27708
|
n = [];
|
|
@@ -28664,9 +29095,9 @@
|
|
|
28664
29095
|
}
|
|
28665
29096
|
children.length && flatten(1 === children.length ? children[0] : children, childrenList);
|
|
28666
29097
|
var g = "Group" === c.name ? new c(attribute) : c(config);
|
|
28667
|
-
return parseToGraphic(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
|
|
29098
|
+
return parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
|
|
28668
29099
|
}
|
|
28669
|
-
function parseToGraphic(g, childrenList, props) {
|
|
29100
|
+
function parseToGraphic$1(g, childrenList, props) {
|
|
28670
29101
|
var out,
|
|
28671
29102
|
isGraphic = !1;
|
|
28672
29103
|
switch (g.type) {
|
|
@@ -28692,6 +29123,47 @@
|
|
|
28692
29123
|
}
|
|
28693
29124
|
var Fragment = Group;
|
|
28694
29125
|
|
|
29126
|
+
function decodeReactDom(dom) {
|
|
29127
|
+
if (!dom || !dom.$$typeof) return dom;
|
|
29128
|
+
var type = dom.type,
|
|
29129
|
+
_dom$props = dom.props,
|
|
29130
|
+
attribute = _dom$props.attribute,
|
|
29131
|
+
children = _dom$props.children,
|
|
29132
|
+
stateProxy = _dom$props.stateProxy,
|
|
29133
|
+
g = type({
|
|
29134
|
+
attribute: attribute
|
|
29135
|
+
}),
|
|
29136
|
+
out = parseToGraphic(g, dom.props, children);
|
|
29137
|
+
return out || (stateProxy && (g.stateProxy = stateProxy), g.id = attribute.id, g.name = attribute.name, isArray$1(children) ? children.forEach(function (item) {
|
|
29138
|
+
var c = decodeReactDom(item);
|
|
29139
|
+
c && c.type && g.add(c);
|
|
29140
|
+
}) : children && g.add(decodeReactDom(children)), g);
|
|
29141
|
+
}
|
|
29142
|
+
function parseToGraphic(g, props, childrenList) {
|
|
29143
|
+
var out,
|
|
29144
|
+
isGraphic = !1;
|
|
29145
|
+
switch (g.type) {
|
|
29146
|
+
case "richtext":
|
|
29147
|
+
break;
|
|
29148
|
+
case "rich/text":
|
|
29149
|
+
out = g.attribute || {}, childrenList && (out.text = childrenList), g.attribute = out;
|
|
29150
|
+
break;
|
|
29151
|
+
case "rich/image":
|
|
29152
|
+
out = g.attribute || {};
|
|
29153
|
+
break;
|
|
29154
|
+
default:
|
|
29155
|
+
isGraphic = !0;
|
|
29156
|
+
}
|
|
29157
|
+
return isGraphic ? Object.keys(props).forEach(function (k) {
|
|
29158
|
+
var en = REACT_TO_CANOPUS_EVENTS[k];
|
|
29159
|
+
en && g.on(en, props[k]);
|
|
29160
|
+
}) : "richtext" === g.type && (g.attribute.textConfig = childrenList.map(function (item) {
|
|
29161
|
+
return decodeReactDom(item);
|
|
29162
|
+
}).filter(function (item) {
|
|
29163
|
+
return item;
|
|
29164
|
+
})), out;
|
|
29165
|
+
}
|
|
29166
|
+
|
|
28695
29167
|
var DragNDrop = /*#__PURE__*/function () {
|
|
28696
29168
|
function DragNDrop(rootNode) {
|
|
28697
29169
|
var _this = this;
|
|
@@ -29919,10 +30391,11 @@
|
|
|
29919
30391
|
}();
|
|
29920
30392
|
DefaultCanvasGroupPicker = __decorate$O([injectable()], DefaultCanvasGroupPicker);
|
|
29921
30393
|
|
|
29922
|
-
var
|
|
29923
|
-
|
|
29924
|
-
loaded$q || (loaded$q = !0, bind(CanvasGroupPicker).to(DefaultCanvasGroupPicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(bind, CanvasPickerContribution));
|
|
30394
|
+
var m$1 = new ContainerModule(function (bind, unbind, isBound, rebind) {
|
|
30395
|
+
m$1.__vloaded || (m$1.__vloaded = !0, bind(CanvasGroupPicker).to(DefaultCanvasGroupPicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(bind, CanvasPickerContribution));
|
|
29925
30396
|
});
|
|
30397
|
+
m$1.__vloaded = !1;
|
|
30398
|
+
var canvasModule = m$1;
|
|
29926
30399
|
|
|
29927
30400
|
var canvasPickerModule = new ContainerModule(function (bind, unbind, isBound, rebind) {
|
|
29928
30401
|
isBound(DefaultCanvasPickerService) || bind(DefaultCanvasPickerService).toSelf().inSingletonScope(), isBound(PickerService) ? rebind(PickerService).toService(DefaultCanvasPickerService) : bind(PickerService).toService(DefaultCanvasPickerService);
|
|
@@ -30269,7 +30742,7 @@
|
|
|
30269
30742
|
key: "getNativeAABBBounds",
|
|
30270
30743
|
value: function getNativeAABBBounds(_dom) {
|
|
30271
30744
|
var dom = _dom;
|
|
30272
|
-
if ("string" == typeof _dom && (dom = new DOMParser().parseFromString(_dom, "text/html").firstChild), dom.getBoundingClientRect) {
|
|
30745
|
+
if ("string" == typeof _dom && (dom = new DOMParser().parseFromString(_dom, "text/html").firstChild, dom.lastChild && (dom = dom.lastChild.firstChild)), dom.getBoundingClientRect) {
|
|
30273
30746
|
var b = dom.getBoundingClientRect();
|
|
30274
30747
|
return new DynamicB(b);
|
|
30275
30748
|
}
|
|
@@ -30431,15 +30904,15 @@
|
|
|
30431
30904
|
}(exports.BaseEnvContribution);
|
|
30432
30905
|
BrowserEnvContribution = __decorate$M([injectable(), __metadata$D("design:paramtypes", [])], BrowserEnvContribution);
|
|
30433
30906
|
|
|
30434
|
-
var isBrowserBound = !1;
|
|
30435
30907
|
var browserEnvModule = new ContainerModule(function (bind) {
|
|
30436
|
-
isBrowserBound || (isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
|
|
30908
|
+
browserEnvModule.isBrowserBound || (browserEnvModule.isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
|
|
30437
30909
|
});
|
|
30438
|
-
|
|
30910
|
+
browserEnvModule.isBrowserBound = !1;
|
|
30439
30911
|
function loadBrowserEnv(container) {
|
|
30440
30912
|
var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
30441
|
-
|
|
30913
|
+
loadBrowserEnv.__loaded || (loadBrowserEnv.__loaded = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
|
|
30442
30914
|
}
|
|
30915
|
+
loadBrowserEnv.__loaded = !1;
|
|
30443
30916
|
function initBrowserEnv() {
|
|
30444
30917
|
loadBrowserEnv(container);
|
|
30445
30918
|
}
|
|
@@ -30804,10 +31277,11 @@
|
|
|
30804
31277
|
}(exports.DefaultPickService);
|
|
30805
31278
|
DefaultMathPickerService = __decorate$I([injectable(), __param$r(0, inject(ContributionProvider)), __param$r(0, named(MathPickerContribution)), __param$r(1, inject(ContributionProvider)), __param$r(1, named(PickItemInterceptor)), __metadata$A("design:paramtypes", [Object, Object])], DefaultMathPickerService);
|
|
30806
31279
|
|
|
30807
|
-
var
|
|
30808
|
-
|
|
30809
|
-
loaded$o || (loaded$o = !0, bindContributionProvider(bind, MathPickerContribution));
|
|
31280
|
+
var m = new ContainerModule(function (bind) {
|
|
31281
|
+
m.__vloaded || (m.__vloaded = !0, bindContributionProvider(bind, MathPickerContribution));
|
|
30810
31282
|
});
|
|
31283
|
+
m.__vloaded = !1;
|
|
31284
|
+
var mathModule = m;
|
|
30811
31285
|
|
|
30812
31286
|
var mathPickerModule = new ContainerModule(function (bind, unbind, isBound, rebind) {
|
|
30813
31287
|
isBound(DefaultMathPickerService) || bind(DefaultMathPickerService).toSelf().inSingletonScope(), isBound(PickerService) ? rebind(PickerService).toService(DefaultMathPickerService) : bind(PickerService).toService(DefaultMathPickerService);
|
|
@@ -30816,6 +31290,105 @@
|
|
|
30816
31290
|
c.load(mathModule), c.load(mathPickerModule);
|
|
30817
31291
|
}
|
|
30818
31292
|
|
|
31293
|
+
var CanvasWrapDisableWH = /*#__PURE__*/function () {
|
|
31294
|
+
function CanvasWrapDisableWH(nativeCanvas, ctx, dpr, w, h, id) {
|
|
31295
|
+
_classCallCheck(this, CanvasWrapDisableWH);
|
|
31296
|
+
this.nativeCanvas = nativeCanvas, this.ctx = ctx, this._w = w, this._h = h, this.id = id, nativeCanvas.id = id, this.dpr = dpr;
|
|
31297
|
+
}
|
|
31298
|
+
_createClass(CanvasWrapDisableWH, [{
|
|
31299
|
+
key: "width",
|
|
31300
|
+
get: function get() {
|
|
31301
|
+
return this._w * this.dpr;
|
|
31302
|
+
},
|
|
31303
|
+
set: function set(w) {}
|
|
31304
|
+
}, {
|
|
31305
|
+
key: "height",
|
|
31306
|
+
get: function get() {
|
|
31307
|
+
return this._h * this.dpr;
|
|
31308
|
+
},
|
|
31309
|
+
set: function set(h) {}
|
|
31310
|
+
}, {
|
|
31311
|
+
key: "offsetWidth",
|
|
31312
|
+
get: function get() {
|
|
31313
|
+
return this._w;
|
|
31314
|
+
},
|
|
31315
|
+
set: function set(w) {}
|
|
31316
|
+
}, {
|
|
31317
|
+
key: "offsetHeight",
|
|
31318
|
+
get: function get() {
|
|
31319
|
+
return this._h;
|
|
31320
|
+
},
|
|
31321
|
+
set: function set(h) {}
|
|
31322
|
+
}, {
|
|
31323
|
+
key: "getContext",
|
|
31324
|
+
value: function getContext() {
|
|
31325
|
+
return this.ctx;
|
|
31326
|
+
}
|
|
31327
|
+
}, {
|
|
31328
|
+
key: "getBoundingClientRect",
|
|
31329
|
+
value: function getBoundingClientRect() {
|
|
31330
|
+
return {
|
|
31331
|
+
width: this._w,
|
|
31332
|
+
height: this._h
|
|
31333
|
+
};
|
|
31334
|
+
}
|
|
31335
|
+
}]);
|
|
31336
|
+
return CanvasWrapDisableWH;
|
|
31337
|
+
}();
|
|
31338
|
+
var CanvasWrapEnableWH = /*#__PURE__*/function () {
|
|
31339
|
+
function CanvasWrapEnableWH(nativeCanvas, ctx, dpr, w, h, id) {
|
|
31340
|
+
_classCallCheck(this, CanvasWrapEnableWH);
|
|
31341
|
+
this.nativeCanvas = nativeCanvas, this.ctx = ctx, this._w = w, this._h = h, this.id = id, nativeCanvas.id = id, this.dpr = dpr;
|
|
31342
|
+
}
|
|
31343
|
+
_createClass(CanvasWrapEnableWH, [{
|
|
31344
|
+
key: "width",
|
|
31345
|
+
get: function get() {
|
|
31346
|
+
return this._w * this.dpr;
|
|
31347
|
+
},
|
|
31348
|
+
set: function set(w) {
|
|
31349
|
+
this._w = w / this.dpr, this.nativeCanvas.width = w;
|
|
31350
|
+
}
|
|
31351
|
+
}, {
|
|
31352
|
+
key: "height",
|
|
31353
|
+
get: function get() {
|
|
31354
|
+
return this._h * this.dpr;
|
|
31355
|
+
},
|
|
31356
|
+
set: function set(h) {
|
|
31357
|
+
this._h = h / this.dpr, this.nativeCanvas.height = h;
|
|
31358
|
+
}
|
|
31359
|
+
}, {
|
|
31360
|
+
key: "offsetWidth",
|
|
31361
|
+
get: function get() {
|
|
31362
|
+
return this._w;
|
|
31363
|
+
},
|
|
31364
|
+
set: function set(w) {
|
|
31365
|
+
this._w = w, this.nativeCanvas.width = w * this.dpr;
|
|
31366
|
+
}
|
|
31367
|
+
}, {
|
|
31368
|
+
key: "offsetHeight",
|
|
31369
|
+
get: function get() {
|
|
31370
|
+
return this._h;
|
|
31371
|
+
},
|
|
31372
|
+
set: function set(h) {
|
|
31373
|
+
this._h = h, this.nativeCanvas.height = h * this.dpr;
|
|
31374
|
+
}
|
|
31375
|
+
}, {
|
|
31376
|
+
key: "getContext",
|
|
31377
|
+
value: function getContext() {
|
|
31378
|
+
return this.ctx;
|
|
31379
|
+
}
|
|
31380
|
+
}, {
|
|
31381
|
+
key: "getBoundingClientRect",
|
|
31382
|
+
value: function getBoundingClientRect() {
|
|
31383
|
+
return {
|
|
31384
|
+
width: this._w,
|
|
31385
|
+
height: this._h
|
|
31386
|
+
};
|
|
31387
|
+
}
|
|
31388
|
+
}]);
|
|
31389
|
+
return CanvasWrapEnableWH;
|
|
31390
|
+
}();
|
|
31391
|
+
|
|
30819
31392
|
var __decorate$H = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
30820
31393
|
var d,
|
|
30821
31394
|
c = arguments.length,
|
|
@@ -30826,31 +31399,12 @@
|
|
|
30826
31399
|
__metadata$z = undefined && undefined.__metadata || function (k, v) {
|
|
30827
31400
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
30828
31401
|
};
|
|
30829
|
-
function makeUpCanvas$3(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
|
|
30830
|
-
var dpr = tt.getSystemInfoSync().pixelRatio;
|
|
31402
|
+
function makeUpCanvas$3(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
|
|
31403
|
+
var dpr = null != pixelRatio ? pixelRatio : tt.getSystemInfoSync().pixelRatio;
|
|
30831
31404
|
canvasIdLists.forEach(function (id, i) {
|
|
30832
|
-
var ctx = tt.createCanvasContext(id)
|
|
30833
|
-
|
|
30834
|
-
|
|
30835
|
-
height: domref.height * dpr
|
|
30836
|
-
};
|
|
30837
|
-
var canvas = {
|
|
30838
|
-
width: domref.width * dpr,
|
|
30839
|
-
height: domref.height * dpr,
|
|
30840
|
-
offsetWidth: domref.width,
|
|
30841
|
-
offsetHeight: domref.height,
|
|
30842
|
-
id: null != id ? id : "",
|
|
30843
|
-
getContext: function getContext() {
|
|
30844
|
-
return ctx;
|
|
30845
|
-
},
|
|
30846
|
-
getBoundingClientRect: function getBoundingClientRect() {
|
|
30847
|
-
return {
|
|
30848
|
-
height: domref.height,
|
|
30849
|
-
width: domref.width
|
|
30850
|
-
};
|
|
30851
|
-
}
|
|
30852
|
-
};
|
|
30853
|
-
canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
|
|
31405
|
+
var ctx = tt.createCanvasContext(id),
|
|
31406
|
+
canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
|
|
31407
|
+
ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
|
|
30854
31408
|
});
|
|
30855
31409
|
}
|
|
30856
31410
|
var FeishuEnvContribution = /*#__PURE__*/function (_BaseEnvContribution) {
|
|
@@ -30881,7 +31435,7 @@
|
|
|
30881
31435
|
}, {
|
|
30882
31436
|
key: "configure",
|
|
30883
31437
|
value: function configure(service, params) {
|
|
30884
|
-
service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$3(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList));
|
|
31438
|
+
service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$3(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.pixelRatio));
|
|
30885
31439
|
}
|
|
30886
31440
|
}, {
|
|
30887
31441
|
key: "loadImage",
|
|
@@ -30971,15 +31525,15 @@
|
|
|
30971
31525
|
}(exports.BaseEnvContribution);
|
|
30972
31526
|
FeishuEnvContribution = __decorate$H([injectable(), __metadata$z("design:paramtypes", [])], FeishuEnvContribution);
|
|
30973
31527
|
|
|
30974
|
-
var isFeishuBound = !1;
|
|
30975
31528
|
var feishuEnvModule = new ContainerModule(function (bind) {
|
|
30976
|
-
isFeishuBound || (isFeishuBound = !0, bind(FeishuEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(FeishuEnvContribution));
|
|
31529
|
+
feishuEnvModule.isFeishuBound || (feishuEnvModule.isFeishuBound = !0, bind(FeishuEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(FeishuEnvContribution));
|
|
30977
31530
|
});
|
|
30978
|
-
|
|
31531
|
+
feishuEnvModule.isFeishuBound = !1;
|
|
30979
31532
|
function loadFeishuEnv(container) {
|
|
30980
31533
|
var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
30981
|
-
|
|
31534
|
+
loadFeishuEnv.__loaded || (loadFeishuEnv.__loaded = !0, container.load(feishuEnvModule), container.load(feishuCanvasModule), container.load(feishuWindowModule), loadPicker && loadMathPicker(container));
|
|
30982
31535
|
}
|
|
31536
|
+
loadFeishuEnv.__loaded = !1;
|
|
30983
31537
|
function initFeishuEnv() {
|
|
30984
31538
|
loadFeishuEnv(container);
|
|
30985
31539
|
}
|
|
@@ -31059,11 +31613,11 @@
|
|
|
31059
31613
|
value: function draw() {
|
|
31060
31614
|
var _this = this;
|
|
31061
31615
|
var _context = this.nativeContext;
|
|
31062
|
-
this.drawPromise = new Promise(function (resolve) {
|
|
31616
|
+
_context.draw && (this.drawPromise = new Promise(function (resolve) {
|
|
31063
31617
|
_context.draw(!0, function () {
|
|
31064
31618
|
_this.drawPromise = null, resolve(null);
|
|
31065
31619
|
});
|
|
31066
|
-
});
|
|
31620
|
+
}));
|
|
31067
31621
|
}
|
|
31068
31622
|
}]);
|
|
31069
31623
|
return LynxContext2d;
|
|
@@ -31332,32 +31886,13 @@
|
|
|
31332
31886
|
try {
|
|
31333
31887
|
ng = !!lynx.createCanvasNG;
|
|
31334
31888
|
} catch (err) {}
|
|
31335
|
-
function makeUpCanvas$2(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
|
|
31336
|
-
var dpr = SystemInfo.pixelRatio;
|
|
31889
|
+
function makeUpCanvas$2(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
|
|
31890
|
+
var dpr = null != pixelRatio ? pixelRatio : SystemInfo.pixelRatio;
|
|
31337
31891
|
canvasIdLists.forEach(function (id, i) {
|
|
31338
31892
|
var _canvas = ng ? lynx.createCanvasNG(id) : lynx.createCanvas(id);
|
|
31339
31893
|
_canvas.width = domref.width * dpr, _canvas.height = domref.height * dpr, ng && _canvas.attachToCanvasView(id);
|
|
31340
|
-
var ctx = _canvas.getContext("2d")
|
|
31341
|
-
|
|
31342
|
-
b();
|
|
31343
|
-
};
|
|
31344
|
-
var canvas = {
|
|
31345
|
-
width: domref.width * dpr,
|
|
31346
|
-
height: domref.height * dpr,
|
|
31347
|
-
offsetWidth: domref.width,
|
|
31348
|
-
offsetHeight: domref.height,
|
|
31349
|
-
id: null != id ? id : "",
|
|
31350
|
-
getContext: function getContext() {
|
|
31351
|
-
return ctx;
|
|
31352
|
-
},
|
|
31353
|
-
getBoundingClientRect: function getBoundingClientRect() {
|
|
31354
|
-
return {
|
|
31355
|
-
height: domref.height,
|
|
31356
|
-
width: domref.width
|
|
31357
|
-
};
|
|
31358
|
-
},
|
|
31359
|
-
nativeCanvas: _canvas
|
|
31360
|
-
};
|
|
31894
|
+
var ctx = _canvas.getContext("2d"),
|
|
31895
|
+
canvas = new CanvasWrapEnableWH(_canvas, ctx, dpr, domref.width, domref.height, id);
|
|
31361
31896
|
canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
|
|
31362
31897
|
});
|
|
31363
31898
|
}
|
|
@@ -31391,7 +31926,7 @@
|
|
|
31391
31926
|
_createClass(LynxEnvContribution, [{
|
|
31392
31927
|
key: "configure",
|
|
31393
31928
|
value: function configure(service, params) {
|
|
31394
|
-
service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$2(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList));
|
|
31929
|
+
service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$2(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.pixelRatio));
|
|
31395
31930
|
}
|
|
31396
31931
|
}, {
|
|
31397
31932
|
key: "getDynamicCanvasCount",
|
|
@@ -31498,15 +32033,15 @@
|
|
|
31498
32033
|
}(exports.BaseEnvContribution);
|
|
31499
32034
|
LynxEnvContribution = __decorate$D([injectable(), __metadata$w("design:paramtypes", [])], LynxEnvContribution);
|
|
31500
32035
|
|
|
31501
|
-
var isLynxBound = !1;
|
|
31502
32036
|
var lynxEnvModule = new ContainerModule(function (bind) {
|
|
31503
|
-
isLynxBound || (isLynxBound = !0, bind(LynxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(LynxEnvContribution));
|
|
32037
|
+
lynxEnvModule.isLynxBound || (lynxEnvModule.isLynxBound = !0, bind(LynxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(LynxEnvContribution));
|
|
31504
32038
|
});
|
|
31505
|
-
|
|
32039
|
+
lynxEnvModule.isLynxBound = !1;
|
|
31506
32040
|
function loadLynxEnv(container) {
|
|
31507
32041
|
var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
31508
|
-
|
|
32042
|
+
loadLynxEnv.__loaded || (loadLynxEnv.__loaded = !0, container.load(lynxEnvModule), container.load(lynxCanvasModule), container.load(lynxWindowModule), loadPicker && loadMathPicker(container));
|
|
31509
32043
|
}
|
|
32044
|
+
loadLynxEnv.__loaded = !1;
|
|
31510
32045
|
function initLynxEnv() {
|
|
31511
32046
|
loadLynxEnv(container);
|
|
31512
32047
|
}
|
|
@@ -31879,14 +32414,14 @@
|
|
|
31879
32414
|
}(exports.BaseEnvContribution);
|
|
31880
32415
|
NodeEnvContribution = __decorate$z([injectable()], NodeEnvContribution);
|
|
31881
32416
|
|
|
31882
|
-
var isNodeBound = !1;
|
|
31883
32417
|
var nodeEnvModule = new ContainerModule(function (bind) {
|
|
31884
|
-
isNodeBound || (isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
|
|
32418
|
+
nodeEnvModule.isNodeBound || (nodeEnvModule.isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
|
|
31885
32419
|
});
|
|
31886
|
-
|
|
32420
|
+
nodeEnvModule.isNodeBound = !1;
|
|
31887
32421
|
function loadNodeEnv(container) {
|
|
31888
|
-
|
|
32422
|
+
loadNodeEnv.__loaded || (loadNodeEnv.__loaded = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
|
|
31889
32423
|
}
|
|
32424
|
+
loadNodeEnv.__loaded = !1;
|
|
31890
32425
|
function initNodeEnv() {
|
|
31891
32426
|
loadNodeEnv(container);
|
|
31892
32427
|
}
|
|
@@ -31983,6 +32518,34 @@
|
|
|
31983
32518
|
value: function createPattern(image, repetition) {
|
|
31984
32519
|
return null;
|
|
31985
32520
|
}
|
|
32521
|
+
}, {
|
|
32522
|
+
key: "getImageData",
|
|
32523
|
+
value: function getImageData(sx, sy, sw, sh) {
|
|
32524
|
+
var _this = this;
|
|
32525
|
+
var ctx = this.nativeContext,
|
|
32526
|
+
taro = ctx.taro;
|
|
32527
|
+
if (ctx && taro) return !ctx.getImageData && taro.canvasGetImageData ? new Promise(function (resolve, reject) {
|
|
32528
|
+
try {
|
|
32529
|
+
taro.canvasGetImageData({
|
|
32530
|
+
canvasId: _this.canvas.nativeCanvas.id,
|
|
32531
|
+
sx: sx,
|
|
32532
|
+
sy: sy,
|
|
32533
|
+
sw: sw,
|
|
32534
|
+
sh: sh,
|
|
32535
|
+
success: function success(res) {
|
|
32536
|
+
resolve(res);
|
|
32537
|
+
}
|
|
32538
|
+
});
|
|
32539
|
+
} catch (err) {
|
|
32540
|
+
reject(err);
|
|
32541
|
+
}
|
|
32542
|
+
}) : void 0;
|
|
32543
|
+
}
|
|
32544
|
+
}, {
|
|
32545
|
+
key: "createRadialGradient",
|
|
32546
|
+
value: function createRadialGradient(x0, y0, r0, x1, y1, r1) {
|
|
32547
|
+
return this.nativeContext.createCircularGradient && this.nativeContext.createCircularGradient(x0, y0, r0, x1, y1, r1);
|
|
32548
|
+
}
|
|
31986
32549
|
}]);
|
|
31987
32550
|
return TaroContext2d;
|
|
31988
32551
|
}(BrowserContext2d);
|
|
@@ -32250,47 +32813,9 @@
|
|
|
32250
32813
|
};
|
|
32251
32814
|
function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, taro, dpr) {
|
|
32252
32815
|
canvasIdLists.forEach(function (id, i) {
|
|
32253
|
-
var ctx = taro.createCanvasContext(id)
|
|
32254
|
-
|
|
32255
|
-
|
|
32256
|
-
height: domref.height * dpr
|
|
32257
|
-
}, ctx.createRadialGradient || (ctx.createRadialGradient = function () {
|
|
32258
|
-
return ctx.createCircularGradient.apply(ctx, arguments);
|
|
32259
|
-
}), !ctx.getImageData && taro.canvasGetImageData && (ctx.getImageData = function (x, y, width, height) {
|
|
32260
|
-
return new Promise(function (resolve, reject) {
|
|
32261
|
-
try {
|
|
32262
|
-
taro.canvasGetImageData({
|
|
32263
|
-
canvasId: id,
|
|
32264
|
-
x: x,
|
|
32265
|
-
y: y,
|
|
32266
|
-
width: width,
|
|
32267
|
-
height: height,
|
|
32268
|
-
success: function success(res) {
|
|
32269
|
-
resolve(res);
|
|
32270
|
-
}
|
|
32271
|
-
});
|
|
32272
|
-
} catch (err) {
|
|
32273
|
-
reject(err);
|
|
32274
|
-
}
|
|
32275
|
-
});
|
|
32276
|
-
});
|
|
32277
|
-
var canvas = {
|
|
32278
|
-
id: id,
|
|
32279
|
-
width: domref.width * dpr,
|
|
32280
|
-
height: domref.height * dpr,
|
|
32281
|
-
offsetWidth: domref.width,
|
|
32282
|
-
offsetHeight: domref.height,
|
|
32283
|
-
getContext: function getContext() {
|
|
32284
|
-
return ctx;
|
|
32285
|
-
},
|
|
32286
|
-
getBoundingClientRect: function getBoundingClientRect() {
|
|
32287
|
-
return {
|
|
32288
|
-
height: domref.height,
|
|
32289
|
-
width: domref.width
|
|
32290
|
-
};
|
|
32291
|
-
}
|
|
32292
|
-
};
|
|
32293
|
-
return canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), canvas;
|
|
32816
|
+
var ctx = taro.createCanvasContext(id),
|
|
32817
|
+
canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
|
|
32818
|
+
return ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), canvas;
|
|
32294
32819
|
});
|
|
32295
32820
|
}
|
|
32296
32821
|
var TaroEnvContribution = /*#__PURE__*/function (_BaseEnvContribution) {
|
|
@@ -32427,15 +32952,15 @@
|
|
|
32427
32952
|
}(exports.BaseEnvContribution);
|
|
32428
32953
|
TaroEnvContribution = __decorate$v([injectable(), __metadata$q("design:paramtypes", [])], TaroEnvContribution);
|
|
32429
32954
|
|
|
32430
|
-
var isTaroBound = !1;
|
|
32431
32955
|
var taroEnvModule = new ContainerModule(function (bind) {
|
|
32432
|
-
isTaroBound || (isTaroBound = !0, bind(TaroEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TaroEnvContribution));
|
|
32956
|
+
taroEnvModule.isTaroBound || (taroEnvModule.isTaroBound = !0, bind(TaroEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TaroEnvContribution));
|
|
32433
32957
|
});
|
|
32434
|
-
|
|
32958
|
+
taroEnvModule.isTaroBound = !1;
|
|
32435
32959
|
function loadTaroEnv(container) {
|
|
32436
32960
|
var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
32437
|
-
|
|
32961
|
+
loadTaroEnv.__loaded || (loadTaroEnv.__loaded = !0, container.load(taroEnvModule), container.load(taroCanvasModule), container.load(taroWindowModule), loadPicker && loadMathPicker(container));
|
|
32438
32962
|
}
|
|
32963
|
+
loadTaroEnv.__loaded = !1;
|
|
32439
32964
|
function initTaroEnv() {
|
|
32440
32965
|
loadTaroEnv(container);
|
|
32441
32966
|
}
|
|
@@ -32902,15 +33427,15 @@
|
|
|
32902
33427
|
}(exports.BaseEnvContribution);
|
|
32903
33428
|
WxEnvContribution = __decorate$r([injectable(), __metadata$n("design:paramtypes", [])], WxEnvContribution);
|
|
32904
33429
|
|
|
32905
|
-
var isWxBound = !1;
|
|
32906
33430
|
var wxEnvModule = new ContainerModule(function (bind) {
|
|
32907
|
-
|
|
33431
|
+
wxEnvModule._isWxBound || (wxEnvModule._isWxBound = !0, bind(WxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(WxEnvContribution));
|
|
32908
33432
|
});
|
|
32909
|
-
|
|
33433
|
+
wxEnvModule._isWxBound = !1;
|
|
32910
33434
|
function loadWxEnv(container) {
|
|
32911
33435
|
var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
32912
|
-
|
|
33436
|
+
loadWxEnv.__loaded || (loadWxEnv.__loaded = !0, container.load(wxEnvModule), container.load(wxCanvasModule), container.load(wxWindowModule), loadPicker && loadMathPicker(container));
|
|
32913
33437
|
}
|
|
33438
|
+
loadWxEnv.__loaded = !1;
|
|
32914
33439
|
function initWxEnv() {
|
|
32915
33440
|
loadWxEnv(container);
|
|
32916
33441
|
}
|
|
@@ -32918,12 +33443,12 @@
|
|
|
32918
33443
|
function loadAllEnv(container) {
|
|
32919
33444
|
loadAllModule(container);
|
|
32920
33445
|
}
|
|
32921
|
-
var loaded$i = !1;
|
|
32922
33446
|
function loadAllModule(container) {
|
|
32923
|
-
|
|
33447
|
+
loadAllModule.__loaded || (loadAllModule.__loaded = !0, loadBrowserEnv(container, !1), loadFeishuEnv(container, !1), loadLynxEnv(container, !1), loadNodeEnv(container), loadTaroEnv(container, !1), loadWxEnv(container, !1), loadCanvasPicker(container), vglobal.hooks.onSetEnv.tap("loadMathPicker", function (lastEnv, env) {
|
|
32924
33448
|
"browser" !== env && loadMathPicker(container);
|
|
32925
33449
|
}));
|
|
32926
33450
|
}
|
|
33451
|
+
loadAllModule.__loaded = !1;
|
|
32927
33452
|
function initAllEnv() {
|
|
32928
33453
|
loadAllEnv(container);
|
|
32929
33454
|
}
|
|
@@ -33090,7 +33615,7 @@
|
|
|
33090
33615
|
x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
|
|
33091
33616
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
33092
33617
|
var picked = !0;
|
|
33093
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
33618
|
+
if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
|
|
33094
33619
|
return 0 !== num;
|
|
33095
33620
|
})) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, function (context, rectAttribute, themeAttribute) {
|
|
33096
33621
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
@@ -33168,7 +33693,7 @@
|
|
|
33168
33693
|
x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
|
|
33169
33694
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
33170
33695
|
var picked = !0;
|
|
33171
|
-
if (!onlyTranslate || isNumber$
|
|
33696
|
+
if (!onlyTranslate || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
|
|
33172
33697
|
return 0 !== num;
|
|
33173
33698
|
})) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, function (context, rectAttribute, themeAttribute) {
|
|
33174
33699
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
@@ -33378,13 +33903,24 @@
|
|
|
33378
33903
|
x = _area$attribute$x === void 0 ? areaAttribute.x : _area$attribute$x,
|
|
33379
33904
|
_area$attribute$y = _area$attribute.y,
|
|
33380
33905
|
y = _area$attribute$y === void 0 ? areaAttribute.y : _area$attribute$y;
|
|
33906
|
+
var _area$attribute2 = area.attribute,
|
|
33907
|
+
_area$attribute2$fill = _area$attribute2.fillPickable,
|
|
33908
|
+
fillPickable = _area$attribute2$fill === void 0 ? areaAttribute.fillPickable : _area$attribute2$fill,
|
|
33909
|
+
_area$attribute2$stro = _area$attribute2.strokePickable,
|
|
33910
|
+
strokePickable = _area$attribute2$stro === void 0 ? areaAttribute.strokePickable : _area$attribute2$stro;
|
|
33381
33911
|
if (pickContext.highPerformanceSave(), area.transMatrix.onlyTranslate()) {
|
|
33382
33912
|
var _point = area.getOffsetXY(areaAttribute);
|
|
33383
33913
|
x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
|
|
33384
33914
|
} else x = 0, y = 0, pickContext.transformFromMatrix(area.transMatrix, !0);
|
|
33385
33915
|
var picked = !1;
|
|
33386
33916
|
return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, function (context) {
|
|
33387
|
-
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33917
|
+
return !!picked || !!fillPickable && (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33918
|
+
}, function (context, areaAttribute, themeAttribute) {
|
|
33919
|
+
if (picked) return !0;
|
|
33920
|
+
if (!strokePickable) return !1;
|
|
33921
|
+
var lineWidth = areaAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33922
|
+
pickStrokeBuffer = areaAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33923
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33388
33924
|
}), pickContext.highPerformanceRestore(), picked;
|
|
33389
33925
|
}
|
|
33390
33926
|
}]);
|
|
@@ -34414,99 +34950,117 @@
|
|
|
34414
34950
|
|
|
34415
34951
|
var browser = isBrowserEnv();
|
|
34416
34952
|
|
|
34417
|
-
|
|
34418
|
-
|
|
34419
|
-
loaded$h || (loaded$h = !0, registerArcGraphic(), container.load(arcModule), container.load(browser ? arcCanvasPickModule : arcMathPickModule));
|
|
34953
|
+
function _registerArc() {
|
|
34954
|
+
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser ? arcCanvasPickModule : arcMathPickModule));
|
|
34420
34955
|
}
|
|
34956
|
+
_registerArc.__loaded = !1;
|
|
34957
|
+
var registerArc = _registerArc;
|
|
34421
34958
|
|
|
34422
|
-
|
|
34423
|
-
|
|
34424
|
-
loaded$g || (loaded$g = !0, registerArc3dGraphic(), container.load(arc3dModule), container.load(arc3dCanvasPickModule));
|
|
34959
|
+
function _registerArc3d() {
|
|
34960
|
+
_registerArc3d.__loaded || (_registerArc3d.__loaded = !0, registerArc3dGraphic(), container.load(arc3dModule), container.load(arc3dCanvasPickModule));
|
|
34425
34961
|
}
|
|
34962
|
+
_registerArc3d.__loaded = !1;
|
|
34963
|
+
var registerArc3d = _registerArc3d;
|
|
34426
34964
|
|
|
34427
|
-
|
|
34428
|
-
|
|
34429
|
-
loaded$f || (loaded$f = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser ? areaCanvasPickModule : areaMathPickModule));
|
|
34965
|
+
function _registerArea() {
|
|
34966
|
+
_registerArea.__loaded || (_registerArea.__loaded = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser ? areaCanvasPickModule : areaMathPickModule));
|
|
34430
34967
|
}
|
|
34968
|
+
_registerArea.__loaded = !1;
|
|
34969
|
+
var registerArea = _registerArea;
|
|
34431
34970
|
|
|
34432
|
-
|
|
34433
|
-
|
|
34434
|
-
loaded$e || (loaded$e = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser ? circleCanvasPickModule : circleMathPickModule));
|
|
34971
|
+
function _registerCircle() {
|
|
34972
|
+
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser ? circleCanvasPickModule : circleMathPickModule));
|
|
34435
34973
|
}
|
|
34974
|
+
_registerCircle.__loaded = !1;
|
|
34975
|
+
var registerCircle = _registerCircle;
|
|
34436
34976
|
|
|
34437
|
-
|
|
34438
|
-
|
|
34439
|
-
loaded$d || (loaded$d = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser ? glyphCanvasPickModule : glyphMathPickModule));
|
|
34977
|
+
function _registerGlyph() {
|
|
34978
|
+
_registerGlyph.__loaded || (_registerGlyph.__loaded = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser ? glyphCanvasPickModule : glyphMathPickModule));
|
|
34440
34979
|
}
|
|
34980
|
+
_registerGlyph.__loaded = !1;
|
|
34981
|
+
var registerGlyph = _registerGlyph;
|
|
34441
34982
|
|
|
34442
|
-
|
|
34443
|
-
|
|
34444
|
-
loaded$c || (loaded$c = !0, registerGroupGraphic());
|
|
34983
|
+
function _registerGroup() {
|
|
34984
|
+
_registerGroup.__loaded || (_registerGroup.__loaded = !0, registerGroupGraphic());
|
|
34445
34985
|
}
|
|
34986
|
+
_registerGroup.__loaded = !1;
|
|
34987
|
+
var registerGroup = _registerGroup;
|
|
34446
34988
|
|
|
34447
|
-
|
|
34448
|
-
|
|
34449
|
-
loaded$b || (loaded$b = !0, registerImageGraphic(), container.load(imageModule), container.load(browser ? imageCanvasPickModule : imageMathPickModule));
|
|
34989
|
+
function _registerImage() {
|
|
34990
|
+
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser ? imageCanvasPickModule : imageMathPickModule));
|
|
34450
34991
|
}
|
|
34992
|
+
_registerImage.__loaded = !1;
|
|
34993
|
+
var registerImage = _registerImage;
|
|
34451
34994
|
|
|
34452
|
-
|
|
34453
|
-
|
|
34454
|
-
loaded$a || (loaded$a = !0, registerLineGraphic(), container.load(lineModule), container.load(browser ? lineCanvasPickModule : lineMathPickModule));
|
|
34995
|
+
function _registerLine() {
|
|
34996
|
+
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser ? lineCanvasPickModule : lineMathPickModule));
|
|
34455
34997
|
}
|
|
34998
|
+
_registerLine.__loaded = !1;
|
|
34999
|
+
var registerLine = _registerLine;
|
|
34456
35000
|
|
|
34457
|
-
|
|
34458
|
-
|
|
34459
|
-
loaded$9 || (loaded$9 = !0, registerPathGraphic(), container.load(pathModule), container.load(browser ? pathCanvasPickModule : pathMathPickModule));
|
|
35001
|
+
function _registerPath() {
|
|
35002
|
+
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser ? pathCanvasPickModule : pathMathPickModule));
|
|
34460
35003
|
}
|
|
35004
|
+
_registerPath.__loaded = !1;
|
|
35005
|
+
var registerPath = _registerPath;
|
|
34461
35006
|
|
|
34462
|
-
|
|
34463
|
-
|
|
34464
|
-
loaded$8 || (loaded$8 = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser ? polygonCanvasPickModule : polygonMathPickModule));
|
|
35007
|
+
function _registerPolygon() {
|
|
35008
|
+
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser ? polygonCanvasPickModule : polygonMathPickModule));
|
|
34465
35009
|
}
|
|
35010
|
+
_registerPolygon.__loaded = !1;
|
|
35011
|
+
var registerPolygon = _registerPolygon;
|
|
34466
35012
|
|
|
34467
|
-
|
|
34468
|
-
|
|
34469
|
-
loaded$7 || (loaded$7 = !0, registerPyramid3dGraphic(), container.load(pyramid3dModule), container.load(pyramid3dCanvasPickModule));
|
|
35013
|
+
function _registerPyramid3d() {
|
|
35014
|
+
_registerPyramid3d.__loaded || (_registerPyramid3d.__loaded = !0, registerPyramid3dGraphic(), container.load(pyramid3dModule), container.load(pyramid3dCanvasPickModule));
|
|
34470
35015
|
}
|
|
35016
|
+
_registerPyramid3d.__loaded = !1;
|
|
35017
|
+
var registerPyramid3d = _registerPyramid3d;
|
|
34471
35018
|
|
|
34472
|
-
|
|
34473
|
-
|
|
34474
|
-
loaded$6 || (loaded$6 = !0, registerRectGraphic(), container.load(rectModule), container.load(browser ? rectCanvasPickModule : rectMathPickModule));
|
|
35019
|
+
function _registerRect() {
|
|
35020
|
+
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser ? rectCanvasPickModule : rectMathPickModule));
|
|
34475
35021
|
}
|
|
35022
|
+
_registerRect.__loaded = !1;
|
|
35023
|
+
var registerRect = _registerRect;
|
|
34476
35024
|
|
|
34477
|
-
|
|
34478
|
-
|
|
34479
|
-
loaded$5 || (loaded$5 = !0, registerRect3dGraphic(), container.load(rect3dModule), container.load(rect3dCanvasPickModule));
|
|
35025
|
+
function _registerRect3d() {
|
|
35026
|
+
_registerRect3d.__loaded || (_registerRect3d.__loaded = !0, registerRect3dGraphic(), container.load(rect3dModule), container.load(rect3dCanvasPickModule));
|
|
34480
35027
|
}
|
|
35028
|
+
_registerRect3d.__loaded = !1;
|
|
35029
|
+
var registerRect3d = _registerRect3d;
|
|
34481
35030
|
|
|
34482
|
-
|
|
34483
|
-
|
|
34484
|
-
loaded$4 || (loaded$4 = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser ? richtextCanvasPickModule : richTextMathPickModule));
|
|
35031
|
+
function _registerRichtext() {
|
|
35032
|
+
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser ? richtextCanvasPickModule : richTextMathPickModule));
|
|
34485
35033
|
}
|
|
35034
|
+
_registerRichtext.__loaded = !1;
|
|
35035
|
+
var registerRichtext = _registerRichtext;
|
|
34486
35036
|
|
|
34487
|
-
|
|
34488
|
-
|
|
34489
|
-
loaded$3 || (loaded$3 = !0, registerShadowRootGraphic());
|
|
35037
|
+
function _registerShadowRoot() {
|
|
35038
|
+
_registerShadowRoot.__loaded || (_registerShadowRoot.__loaded = !0, registerShadowRootGraphic());
|
|
34490
35039
|
}
|
|
35040
|
+
_registerShadowRoot.__loaded = !1;
|
|
35041
|
+
var registerShadowRoot = _registerShadowRoot;
|
|
34491
35042
|
|
|
34492
|
-
|
|
34493
|
-
|
|
34494
|
-
loaded$2 || (loaded$2 = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser ? symbolCanvasPickModule : symbolMathPickModule));
|
|
35043
|
+
function _registerSymbol() {
|
|
35044
|
+
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser ? symbolCanvasPickModule : symbolMathPickModule));
|
|
34495
35045
|
}
|
|
35046
|
+
_registerSymbol.__loaded = !1;
|
|
35047
|
+
var registerSymbol = _registerSymbol;
|
|
34496
35048
|
|
|
34497
|
-
|
|
34498
|
-
|
|
34499
|
-
loaded$1 || (loaded$1 = !0, registerTextGraphic(), container.load(textModule), container.load(browser ? textCanvasPickModule : textMathPickModule));
|
|
35049
|
+
function _registerText() {
|
|
35050
|
+
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser ? textCanvasPickModule : textMathPickModule));
|
|
34500
35051
|
}
|
|
35052
|
+
_registerText.__loaded = !1;
|
|
35053
|
+
var registerText = _registerText;
|
|
34501
35054
|
|
|
34502
|
-
|
|
34503
|
-
|
|
34504
|
-
loaded || (loaded = !0, registerWrapTextGraphic());
|
|
35055
|
+
function _registerWrapText() {
|
|
35056
|
+
_registerWrapText.__loaded || (_registerWrapText.__loaded = !0, registerWrapTextGraphic());
|
|
34505
35057
|
}
|
|
35058
|
+
_registerWrapText.__loaded = !1;
|
|
35059
|
+
var registerWrapText = _registerWrapText;
|
|
34506
35060
|
|
|
34507
35061
|
var roughModule = _roughModule;
|
|
34508
35062
|
|
|
34509
|
-
const version = "0.18.0-alpha.
|
|
35063
|
+
const version = "0.18.0-alpha.1";
|
|
34510
35064
|
preLoadAllModule();
|
|
34511
35065
|
if (isBrowserEnv()) {
|
|
34512
35066
|
loadBrowserEnv(container);
|
|
@@ -34557,6 +35111,7 @@
|
|
|
34557
35111
|
exports.BoundsContext = BoundsContext;
|
|
34558
35112
|
exports.BoundsPicker = BoundsPicker;
|
|
34559
35113
|
exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
|
|
35114
|
+
exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
|
|
34560
35115
|
exports.CanvasFactory = CanvasFactory;
|
|
34561
35116
|
exports.CanvasTextLayout = CanvasTextLayout;
|
|
34562
35117
|
exports.CbAnimate = CbAnimate;
|
|
@@ -34578,11 +35133,13 @@
|
|
|
34578
35133
|
exports.CustomEvent = CustomEvent;
|
|
34579
35134
|
exports.CustomPath2D = CustomPath2D;
|
|
34580
35135
|
exports.CustomSymbolClass = CustomSymbolClass;
|
|
35136
|
+
exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
|
|
34581
35137
|
exports.DefaultArcAllocate = DefaultArcAllocate;
|
|
34582
35138
|
exports.DefaultArcAttribute = DefaultArcAttribute;
|
|
34583
35139
|
exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
|
|
34584
35140
|
exports.DefaultAreaAllocate = DefaultAreaAllocate;
|
|
34585
35141
|
exports.DefaultAreaAttribute = DefaultAreaAttribute;
|
|
35142
|
+
exports.DefaultAreaTextureRenderContribution = DefaultAreaTextureRenderContribution;
|
|
34586
35143
|
exports.DefaultAttribute = DefaultAttribute;
|
|
34587
35144
|
exports.DefaultBaseBackgroundRenderContribution = DefaultBaseBackgroundRenderContribution;
|
|
34588
35145
|
exports.DefaultBaseTextureRenderContribution = DefaultBaseTextureRenderContribution;
|
|
@@ -34630,6 +35187,7 @@
|
|
|
34630
35187
|
exports.DefaultTransform = DefaultTransform;
|
|
34631
35188
|
exports.DragNDrop = DragNDrop;
|
|
34632
35189
|
exports.DrawContribution = DrawContribution;
|
|
35190
|
+
exports.DrawItemInterceptor = DrawItemInterceptor;
|
|
34633
35191
|
exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
|
|
34634
35192
|
exports.EnvContribution = EnvContribution;
|
|
34635
35193
|
exports.EventManager = EventManager;
|
|
@@ -34668,6 +35226,7 @@
|
|
|
34668
35226
|
exports.IncreaseCount = IncreaseCount;
|
|
34669
35227
|
exports.IncrementalDrawContribution = IncrementalDrawContribution;
|
|
34670
35228
|
exports.InputText = InputText;
|
|
35229
|
+
exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
|
|
34671
35230
|
exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
|
|
34672
35231
|
exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
|
|
34673
35232
|
exports.Layer = Layer;
|
|
@@ -34729,6 +35288,7 @@
|
|
|
34729
35288
|
exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
|
|
34730
35289
|
exports.SegContext = SegContext;
|
|
34731
35290
|
exports.ShadowRoot = ShadowRoot;
|
|
35291
|
+
exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
|
|
34732
35292
|
exports.Stage = Stage;
|
|
34733
35293
|
exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
|
|
34734
35294
|
exports.Step = Step$1;
|
|
@@ -34769,6 +35329,7 @@
|
|
|
34769
35329
|
exports.WindowHandlerContribution = WindowHandlerContribution;
|
|
34770
35330
|
exports.WrapText = WrapText;
|
|
34771
35331
|
exports.XMLParser = XMLParser;
|
|
35332
|
+
exports._registerArc = _registerArc;
|
|
34772
35333
|
exports.addArcToBezierPath = addArcToBezierPath$1;
|
|
34773
35334
|
exports.addAttributeToPrototype = addAttributeToPrototype;
|
|
34774
35335
|
exports.alignBezierCurves = alignBezierCurves;
|
|
@@ -34834,6 +35395,7 @@
|
|
|
34834
35395
|
exports.cubicLength = cubicLength;
|
|
34835
35396
|
exports.cubicPointAt = cubicPointAt;
|
|
34836
35397
|
exports.cubicSubdivide = cubicSubdivide;
|
|
35398
|
+
exports.decodeReactDom = decodeReactDom;
|
|
34837
35399
|
exports.defaultArcAllocate = defaultArcAllocate;
|
|
34838
35400
|
exports.defaultArcBackgroundRenderContribution = defaultArcBackgroundRenderContribution;
|
|
34839
35401
|
exports.defaultArcRenderContribution = defaultArcRenderContribution;
|
|
@@ -34882,9 +35444,9 @@
|
|
|
34882
35444
|
exports.genLinearSegments = genLinearSegments;
|
|
34883
35445
|
exports.genLinearTypeSegments = genLinearTypeSegments;
|
|
34884
35446
|
exports.genMonotoneXSegments = genMonotoneXSegments;
|
|
35447
|
+
exports.genMonotoneXTypeSegments = genMonotoneXTypeSegments;
|
|
34885
35448
|
exports.genMonotoneYSegments = genMonotoneYSegments;
|
|
34886
|
-
exports.
|
|
34887
|
-
exports.genMonotpneYTypeSegments = genMonotpneYTypeSegments;
|
|
35449
|
+
exports.genMonotoneYTypeSegments = genMonotoneYTypeSegments;
|
|
34888
35450
|
exports.genNumberType = genNumberType;
|
|
34889
35451
|
exports.genStepSegments = genStepSegments;
|
|
34890
35452
|
exports.genStepTypeSegments = genStepTypeSegments;
|