@visactor/vrender 0.17.20-alpha.1 → 0.17.20-alpha.10
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 +849 -734
- 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
|
@@ -4784,6 +4784,11 @@
|
|
|
4784
4784
|
value: function clear() {
|
|
4785
4785
|
this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
|
|
4786
4786
|
}
|
|
4787
|
+
}, {
|
|
4788
|
+
key: "beginPath",
|
|
4789
|
+
value: function beginPath() {
|
|
4790
|
+
this.clear();
|
|
4791
|
+
}
|
|
4787
4792
|
}, {
|
|
4788
4793
|
key: "toString",
|
|
4789
4794
|
value: function toString() {
|
|
@@ -4803,6 +4808,8 @@
|
|
|
4803
4808
|
var path = "";
|
|
4804
4809
|
for (var i = 0; i < bezierPathList.length; i += 6) path += "C".concat(bezierPathList[i], " ").concat(bezierPathList[i + 1], " ").concat(bezierPathList[i + 2], " ").concat(bezierPathList[i + 3], " ").concat(bezierPathList[i + 4], " ").concat(bezierPathList[i + 5]);
|
|
4805
4810
|
return path;
|
|
4811
|
+
}, _list[enumCommandMap.R] = function (cmd) {
|
|
4812
|
+
return "M".concat(cmd[1], " ").concat(cmd[2], " h").concat(cmd[3], " v").concat(cmd[4], " H").concat(cmd[1], "Z");
|
|
4806
4813
|
}, _list[enumCommandMap.Z] = function (cmd) {
|
|
4807
4814
|
return "Z";
|
|
4808
4815
|
}, this.toStringCbList = _list;
|
|
@@ -5188,6 +5195,7 @@
|
|
|
5188
5195
|
zIndex: 0,
|
|
5189
5196
|
layout: null,
|
|
5190
5197
|
boundsPadding: 0,
|
|
5198
|
+
renderStyle: "default",
|
|
5191
5199
|
pickMode: "accurate",
|
|
5192
5200
|
customPickShape: null,
|
|
5193
5201
|
boundsMode: "accurate",
|
|
@@ -6283,9 +6291,20 @@
|
|
|
6283
6291
|
}, {
|
|
6284
6292
|
key: "create",
|
|
6285
6293
|
value: function create(params) {
|
|
6294
|
+
var _a, _b;
|
|
6286
6295
|
this._handler.createWindow(params);
|
|
6287
6296
|
var windowWH = this._handler.getWH();
|
|
6288
|
-
this._width = windowWH.width, this._height = windowWH.height,
|
|
6297
|
+
this._width = windowWH.width, this._height = windowWH.height, params.viewBox ? this.setViewBox(params.viewBox) : !1 !== params.canvasControled ? this.setViewBox({
|
|
6298
|
+
x1: 0,
|
|
6299
|
+
y1: 0,
|
|
6300
|
+
x2: this._width,
|
|
6301
|
+
y2: this._height
|
|
6302
|
+
}) : this.setViewBox({
|
|
6303
|
+
x1: 0,
|
|
6304
|
+
y1: 0,
|
|
6305
|
+
x2: null !== (_a = params.width) && void 0 !== _a ? _a : this._width,
|
|
6306
|
+
y2: null !== (_b = params.height) && void 0 !== _b ? _b : this._height
|
|
6307
|
+
}), this.title = this._handler.getTitle(), this.resizable = !0;
|
|
6289
6308
|
}
|
|
6290
6309
|
}, {
|
|
6291
6310
|
key: "setWindowHandler",
|
|
@@ -6354,8 +6373,47 @@
|
|
|
6354
6373
|
}
|
|
6355
6374
|
}, {
|
|
6356
6375
|
key: "clearViewBox",
|
|
6357
|
-
value: function clearViewBox(
|
|
6358
|
-
this._handler.clearViewBox(
|
|
6376
|
+
value: function clearViewBox(color) {
|
|
6377
|
+
this._handler.clearViewBox(color);
|
|
6378
|
+
}
|
|
6379
|
+
}, {
|
|
6380
|
+
key: "setViewBox",
|
|
6381
|
+
value: function setViewBox(viewBox) {
|
|
6382
|
+
this._handler.setViewBox(viewBox);
|
|
6383
|
+
}
|
|
6384
|
+
}, {
|
|
6385
|
+
key: "setViewBoxTransform",
|
|
6386
|
+
value: function setViewBoxTransform(a, b, c, d, e, f) {
|
|
6387
|
+
this._handler.setViewBoxTransform(a, b, c, d, e, f);
|
|
6388
|
+
}
|
|
6389
|
+
}, {
|
|
6390
|
+
key: "getViewBox",
|
|
6391
|
+
value: function getViewBox() {
|
|
6392
|
+
return this._handler.getViewBox();
|
|
6393
|
+
}
|
|
6394
|
+
}, {
|
|
6395
|
+
key: "getViewBoxTransform",
|
|
6396
|
+
value: function getViewBoxTransform() {
|
|
6397
|
+
return this._handler.getViewBoxTransform();
|
|
6398
|
+
}
|
|
6399
|
+
}, {
|
|
6400
|
+
key: "pointTransform",
|
|
6401
|
+
value: function pointTransform(x, y) {
|
|
6402
|
+
var vb = this._handler.getViewBox(),
|
|
6403
|
+
nextP = {
|
|
6404
|
+
x: x,
|
|
6405
|
+
y: y
|
|
6406
|
+
};
|
|
6407
|
+
return this._handler.getViewBoxTransform().transformPoint({
|
|
6408
|
+
x: x,
|
|
6409
|
+
y: y
|
|
6410
|
+
}, nextP), nextP.x -= vb.x1, nextP.y -= vb.y1, nextP;
|
|
6411
|
+
}
|
|
6412
|
+
}, {
|
|
6413
|
+
key: "hasSubView",
|
|
6414
|
+
value: function hasSubView() {
|
|
6415
|
+
var viewBox = this._handler.getViewBox();
|
|
6416
|
+
return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
|
|
6359
6417
|
}
|
|
6360
6418
|
}, {
|
|
6361
6419
|
key: "isVisible",
|
|
@@ -6473,8 +6531,16 @@
|
|
|
6473
6531
|
var window = container.get(VWindow),
|
|
6474
6532
|
bounds = graphic.AABBBounds,
|
|
6475
6533
|
width = bounds.width(),
|
|
6476
|
-
height = bounds.height()
|
|
6534
|
+
height = bounds.height(),
|
|
6535
|
+
x1 = -bounds.x1,
|
|
6536
|
+
y1 = -bounds.y1;
|
|
6477
6537
|
window.create({
|
|
6538
|
+
viewBox: {
|
|
6539
|
+
x1: x1,
|
|
6540
|
+
y1: y1,
|
|
6541
|
+
x2: bounds.x2,
|
|
6542
|
+
y2: bounds.y2
|
|
6543
|
+
},
|
|
6478
6544
|
width: width,
|
|
6479
6545
|
height: height,
|
|
6480
6546
|
canvas: canvas,
|
|
@@ -6483,14 +6549,10 @@
|
|
|
6483
6549
|
offscreen: !0,
|
|
6484
6550
|
title: ""
|
|
6485
6551
|
});
|
|
6486
|
-
var
|
|
6487
|
-
y = -bounds.y1,
|
|
6488
|
-
disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
|
|
6552
|
+
var disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
|
|
6489
6553
|
stage.params.optimize.disableCheckGraphicWidthOutRange = !0, stage.defaultLayer.getNativeHandler().drawTo(window, [graphic], {
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
width: width,
|
|
6493
|
-
height: height,
|
|
6554
|
+
transMatrix: window.getViewBoxTransform(),
|
|
6555
|
+
viewBox: window.getViewBox(),
|
|
6494
6556
|
stage: stage,
|
|
6495
6557
|
layer: stage.defaultLayer,
|
|
6496
6558
|
renderService: stage.renderService,
|
|
@@ -6707,7 +6769,7 @@
|
|
|
6707
6769
|
}();
|
|
6708
6770
|
var globalTheme = new Theme();
|
|
6709
6771
|
function getTheme(graphic, theme) {
|
|
6710
|
-
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
|
|
6772
|
+
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
6711
6773
|
}
|
|
6712
6774
|
function getThemeFromGroup(graphic) {
|
|
6713
6775
|
var g;
|
|
@@ -6971,10 +7033,13 @@
|
|
|
6971
7033
|
}
|
|
6972
7034
|
}, {
|
|
6973
7035
|
key: "removeAllChild",
|
|
6974
|
-
value: function removeAllChild() {
|
|
7036
|
+
value: function removeAllChild(deep) {
|
|
6975
7037
|
if (!this._idMap) return;
|
|
6976
7038
|
var child = this._firstChild;
|
|
6977
|
-
for (; child;)
|
|
7039
|
+
for (; child;) {
|
|
7040
|
+
var next = child._next;
|
|
7041
|
+
child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
|
|
7042
|
+
}
|
|
6978
7043
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
6979
7044
|
}
|
|
6980
7045
|
}, {
|
|
@@ -7652,7 +7717,7 @@
|
|
|
7652
7717
|
var mappers = this.mappingTable[e.type];
|
|
7653
7718
|
var target;
|
|
7654
7719
|
var cacheKey = "".concat(e.canvasX, "-").concat(e.canvasY);
|
|
7655
|
-
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.
|
|
7720
|
+
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.viewX, e.viewY, e), e.pickParams || (this._prePointTargetCache = _defineProperty(_defineProperty({}, cacheKey, target), "stageRenderCount", null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else Logger.getInstance().warn("[EventManager]: Event mapping not defined for ".concat(e.type));
|
|
7656
7721
|
}
|
|
7657
7722
|
}, {
|
|
7658
7723
|
key: "propagate",
|
|
@@ -7694,14 +7759,16 @@
|
|
|
7694
7759
|
}, {
|
|
7695
7760
|
key: "createPointerEvent",
|
|
7696
7761
|
value: function createPointerEvent(from, type, target) {
|
|
7762
|
+
var _a, _b;
|
|
7697
7763
|
var event = this.allocateEvent(FederatedPointerEvent);
|
|
7698
|
-
return this.copyPointerData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(event.global.x, event.global.y, event), "string" == typeof type && (event.type = type), event;
|
|
7764
|
+
return this.copyPointerData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(null !== (_a = event.viewX) && void 0 !== _a ? _a : event.global.x, null !== (_b = event.viewY) && void 0 !== _b ? _b : event.global.y, event), "string" == typeof type && (event.type = type), event;
|
|
7699
7765
|
}
|
|
7700
7766
|
}, {
|
|
7701
7767
|
key: "createWheelEvent",
|
|
7702
7768
|
value: function createWheelEvent(from, target) {
|
|
7769
|
+
var _a, _b;
|
|
7703
7770
|
var event = this.allocateEvent(FederatedWheelEvent);
|
|
7704
|
-
return this.copyWheelData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(event.global.x, event.global.y, event), event;
|
|
7771
|
+
return this.copyWheelData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(null !== (_a = event.viewX) && void 0 !== _a ? _a : event.global.x, null !== (_b = event.viewY) && void 0 !== _b ? _b : event.global.y, event), event;
|
|
7705
7772
|
}
|
|
7706
7773
|
}, {
|
|
7707
7774
|
key: "clonePointerEvent",
|
|
@@ -7831,7 +7898,7 @@
|
|
|
7831
7898
|
_this.setCursor(_this.manager.cursor, _this.manager.cursorTarget);
|
|
7832
7899
|
}, this.onPointerUp = function (nativeEvent) {
|
|
7833
7900
|
if (_this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
|
|
7834
|
-
var outside = _this.
|
|
7901
|
+
var outside = _this.isEventOutsideOfTargetViewPort(nativeEvent) ? "outside" : "",
|
|
7835
7902
|
normalizedEvents = _this.normalizeToPointerData(nativeEvent);
|
|
7836
7903
|
for (var i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
7837
7904
|
var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvents[i]);
|
|
@@ -7854,7 +7921,6 @@
|
|
|
7854
7921
|
resolution = params.resolution,
|
|
7855
7922
|
rootNode = params.rootNode,
|
|
7856
7923
|
global = params.global,
|
|
7857
|
-
viewport = params.viewport,
|
|
7858
7924
|
_params$autoPreventDe = params.autoPreventDefault,
|
|
7859
7925
|
autoPreventDefault = _params$autoPreventDe === void 0 ? !1 : _params$autoPreventDe,
|
|
7860
7926
|
clickInterval = params.clickInterval,
|
|
@@ -7864,7 +7930,7 @@
|
|
|
7864
7930
|
supportsPointerEvents = _params$supportsPoint === void 0 ? global.supportsPointerEvents : _params$supportsPoint;
|
|
7865
7931
|
this.manager = new EventManager(rootNode, {
|
|
7866
7932
|
clickInterval: clickInterval
|
|
7867
|
-
}), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.
|
|
7933
|
+
}), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
|
|
7868
7934
|
"default": "inherit",
|
|
7869
7935
|
pointer: "pointer"
|
|
7870
7936
|
}, this.resolution = resolution, this.setTargetElement(targetElement);
|
|
@@ -7912,13 +7978,7 @@
|
|
|
7912
7978
|
}, {
|
|
7913
7979
|
key: "mapToViewportPoint",
|
|
7914
7980
|
value: function mapToViewportPoint(event) {
|
|
7915
|
-
|
|
7916
|
-
x = event.x,
|
|
7917
|
-
y = event.y;
|
|
7918
|
-
return {
|
|
7919
|
-
x: x - viewport.x,
|
|
7920
|
-
y: y - viewport.y
|
|
7921
|
-
};
|
|
7981
|
+
return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
|
|
7922
7982
|
}
|
|
7923
7983
|
}, {
|
|
7924
7984
|
key: "mapToCanvasPoint",
|
|
@@ -7979,6 +8039,19 @@
|
|
|
7979
8039
|
value: function transferMouseData(event, nativeEvent) {
|
|
7980
8040
|
event.isTrusted = nativeEvent.isTrusted, event.srcElement = nativeEvent.srcElement, event.timeStamp = clock.now(), event.type = nativeEvent.type, event.altKey = nativeEvent.altKey, event.button = nativeEvent.button, event.buttons = nativeEvent.buttons, event.client.x = nativeEvent.clientX, event.client.y = nativeEvent.clientY, event.ctrlKey = nativeEvent.ctrlKey, event.shiftKey = nativeEvent.shiftKey, event.metaKey = nativeEvent.metaKey, event.movement.x = nativeEvent.movementX, event.movement.y = nativeEvent.movementY, event.page.x = nativeEvent.pageX, event.page.y = nativeEvent.pageY, event.relatedTarget = null;
|
|
7981
8041
|
}
|
|
8042
|
+
}, {
|
|
8043
|
+
key: "isEventOutsideOfTargetViewPort",
|
|
8044
|
+
value: function isEventOutsideOfTargetViewPort(nativeEvent) {
|
|
8045
|
+
if (this.isEventOutsideOfTargetElement(nativeEvent)) return !0;
|
|
8046
|
+
if (this.domElement.getViewBox) {
|
|
8047
|
+
var p = this.mapToViewportPoint(this.mapToCanvasPoint(nativeEvent)),
|
|
8048
|
+
b = this.domElement.getViewBox(),
|
|
8049
|
+
w = b.width(),
|
|
8050
|
+
h = b.height();
|
|
8051
|
+
return !(p.x < w && p.y < h && p.x > 0 && p.y > 0);
|
|
8052
|
+
}
|
|
8053
|
+
return !1;
|
|
8054
|
+
}
|
|
7982
8055
|
}, {
|
|
7983
8056
|
key: "isEventOutsideOfTargetElement",
|
|
7984
8057
|
value: function isEventOutsideOfTargetElement(nativeEvent) {
|
|
@@ -11358,15 +11431,7 @@
|
|
|
11358
11431
|
var data = ResourceLoader.cache.get(url);
|
|
11359
11432
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
|
|
11360
11433
|
mark.imageLoadFail(url);
|
|
11361
|
-
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (
|
|
11362
|
-
type: "image",
|
|
11363
|
-
loadState: "init"
|
|
11364
|
-
}, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
|
|
11365
|
-
var _a;
|
|
11366
|
-
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) {
|
|
11367
|
-
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
11368
|
-
});
|
|
11369
|
-
})) : (data.loadState = "fail", mark.imageLoadFail(url)));
|
|
11434
|
+
}) : "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);
|
|
11370
11435
|
}
|
|
11371
11436
|
}, {
|
|
11372
11437
|
key: "GetSvg",
|
|
@@ -11400,10 +11465,68 @@
|
|
|
11400
11465
|
return data.data;
|
|
11401
11466
|
}));
|
|
11402
11467
|
}
|
|
11468
|
+
}, {
|
|
11469
|
+
key: "loading",
|
|
11470
|
+
value: function loading() {
|
|
11471
|
+
setTimeout(function () {
|
|
11472
|
+
if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
|
|
11473
|
+
ResourceLoader.isLoading = !0;
|
|
11474
|
+
var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
|
|
11475
|
+
promises = [];
|
|
11476
|
+
tasks.forEach(function (task) {
|
|
11477
|
+
var url = task.url,
|
|
11478
|
+
marks = task.marks,
|
|
11479
|
+
data = {
|
|
11480
|
+
type: "image",
|
|
11481
|
+
loadState: "init"
|
|
11482
|
+
};
|
|
11483
|
+
if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
|
|
11484
|
+
data.waitingMark = marks;
|
|
11485
|
+
var end = data.dataPromise.then(function (res) {
|
|
11486
|
+
var _a;
|
|
11487
|
+
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) {
|
|
11488
|
+
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
11489
|
+
});
|
|
11490
|
+
});
|
|
11491
|
+
promises.push(end);
|
|
11492
|
+
} else data.loadState = "fail", marks.forEach(function (mark) {
|
|
11493
|
+
return mark.imageLoadFail(url);
|
|
11494
|
+
});
|
|
11495
|
+
}), Promise.all(promises).then(function () {
|
|
11496
|
+
ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11497
|
+
})["catch"](function (error) {
|
|
11498
|
+
console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11499
|
+
});
|
|
11500
|
+
}
|
|
11501
|
+
}, 0);
|
|
11502
|
+
}
|
|
11503
|
+
}, {
|
|
11504
|
+
key: "loadImage",
|
|
11505
|
+
value: function loadImage(url, mark) {
|
|
11506
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11507
|
+
if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
|
|
11508
|
+
ResourceLoader.toLoadAueue.push({
|
|
11509
|
+
url: url,
|
|
11510
|
+
marks: [mark]
|
|
11511
|
+
}), ResourceLoader.loading();
|
|
11512
|
+
}
|
|
11513
|
+
}, {
|
|
11514
|
+
key: "improveImageLoading",
|
|
11515
|
+
value: function improveImageLoading(url) {
|
|
11516
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11517
|
+
if (-1 !== index) {
|
|
11518
|
+
var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
|
|
11519
|
+
ResourceLoader.toLoadAueue.unshift(elememt[0]);
|
|
11520
|
+
}
|
|
11521
|
+
}
|
|
11403
11522
|
}]);
|
|
11404
11523
|
return ResourceLoader;
|
|
11405
11524
|
}();
|
|
11406
|
-
|
|
11525
|
+
function getIndex(url, arr) {
|
|
11526
|
+
for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
|
|
11527
|
+
return -1;
|
|
11528
|
+
}
|
|
11529
|
+
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
11407
11530
|
|
|
11408
11531
|
var tempMatrix = new Matrix(),
|
|
11409
11532
|
tempBounds$1 = new AABBBounds();
|
|
@@ -11534,7 +11657,8 @@
|
|
|
11534
11657
|
}, {
|
|
11535
11658
|
key: "tryUpdateGlobalAABBBounds",
|
|
11536
11659
|
value: function tryUpdateGlobalAABBBounds() {
|
|
11537
|
-
|
|
11660
|
+
var b = this.AABBBounds;
|
|
11661
|
+
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;
|
|
11538
11662
|
}
|
|
11539
11663
|
}, {
|
|
11540
11664
|
key: "tryUpdateGlobalTransMatrix",
|
|
@@ -12189,7 +12313,7 @@
|
|
|
12189
12313
|
data: "init",
|
|
12190
12314
|
state: null
|
|
12191
12315
|
};
|
|
12192
|
-
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);
|
|
12316
|
+
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";
|
|
12193
12317
|
}
|
|
12194
12318
|
}, {
|
|
12195
12319
|
key: "imageLoadSuccess",
|
|
@@ -12840,8 +12964,9 @@
|
|
|
12840
12964
|
}, {
|
|
12841
12965
|
key: "removeAllChild",
|
|
12842
12966
|
value: function removeAllChild() {
|
|
12967
|
+
var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
12843
12968
|
this.forEachChildren(function (child) {
|
|
12844
|
-
application.graphicService.onRemove(child);
|
|
12969
|
+
application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
12845
12970
|
}), _get(_getPrototypeOf(Group.prototype), "removeAllChild", this).call(this), this.addUpdateBoundTag();
|
|
12846
12971
|
}
|
|
12847
12972
|
}, {
|
|
@@ -13017,15 +13142,12 @@
|
|
|
13017
13142
|
value: function render(params, userParams) {
|
|
13018
13143
|
var _this4 = this;
|
|
13019
13144
|
var _a;
|
|
13020
|
-
var stage = this.stage;
|
|
13021
13145
|
this.layerHandler.render([this], {
|
|
13022
13146
|
renderService: params.renderService,
|
|
13023
|
-
x: stage.x,
|
|
13024
|
-
y: stage.y,
|
|
13025
|
-
width: this.viewWidth,
|
|
13026
|
-
height: this.viewHeight,
|
|
13027
13147
|
stage: this.stage,
|
|
13028
13148
|
layer: this,
|
|
13149
|
+
viewBox: params.viewBox,
|
|
13150
|
+
transMatrix: params.transMatrix,
|
|
13029
13151
|
background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
|
|
13030
13152
|
updateBounds: params.updateBounds
|
|
13031
13153
|
}, userParams), this.afterDrawCbs.forEach(function (c) {
|
|
@@ -13065,48 +13187,28 @@
|
|
|
13065
13187
|
}, {
|
|
13066
13188
|
key: "prepare",
|
|
13067
13189
|
value: function prepare(dirtyBounds, params) {}
|
|
13068
|
-
}, {
|
|
13069
|
-
key: "combineTo",
|
|
13070
|
-
value: function combineTo(target, params) {
|
|
13071
|
-
var _this5 = this;
|
|
13072
|
-
var _a, _b, _c;
|
|
13073
|
-
this.offscreen && (this.layerHandler.drawTo(target, [this], Object.assign({
|
|
13074
|
-
background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
|
|
13075
|
-
renderService: params.renderService,
|
|
13076
|
-
x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
|
|
13077
|
-
y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
|
|
13078
|
-
width: this.viewWidth,
|
|
13079
|
-
height: this.viewHeight,
|
|
13080
|
-
stage: this.stage,
|
|
13081
|
-
layer: this
|
|
13082
|
-
}, params)), this.afterDrawCbs.forEach(function (c) {
|
|
13083
|
-
return c(_this5);
|
|
13084
|
-
}));
|
|
13085
|
-
}
|
|
13086
13190
|
}, {
|
|
13087
13191
|
key: "release",
|
|
13088
13192
|
value: function release() {
|
|
13089
|
-
var
|
|
13193
|
+
var _this5 = this;
|
|
13090
13194
|
_get(_getPrototypeOf(Layer.prototype), "release", this).call(this), this.layerHandler.release(), this.subLayers && this.subLayers.forEach(function (l) {
|
|
13091
|
-
application.layerService.releaseLayer(
|
|
13195
|
+
application.layerService.releaseLayer(_this5.stage, l.layer);
|
|
13092
13196
|
});
|
|
13093
13197
|
}
|
|
13094
13198
|
}, {
|
|
13095
13199
|
key: "drawTo",
|
|
13096
13200
|
value: function drawTo(target, params) {
|
|
13097
|
-
var
|
|
13098
|
-
var _a
|
|
13201
|
+
var _this6 = this;
|
|
13202
|
+
var _a;
|
|
13099
13203
|
this.layerHandler.drawTo(target, [this], Object.assign({
|
|
13100
13204
|
background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
|
|
13101
13205
|
renderService: params.renderService,
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
width: this.viewWidth,
|
|
13105
|
-
height: this.viewHeight,
|
|
13206
|
+
viewBox: params.viewBox,
|
|
13207
|
+
transMatrix: params.transMatrix,
|
|
13106
13208
|
stage: this.stage,
|
|
13107
13209
|
layer: this
|
|
13108
13210
|
}, params)), this.afterDrawCbs.forEach(function (c) {
|
|
13109
|
-
return c(
|
|
13211
|
+
return c(_this6);
|
|
13110
13212
|
});
|
|
13111
13213
|
}
|
|
13112
13214
|
}]);
|
|
@@ -16532,10 +16634,10 @@
|
|
|
16532
16634
|
}
|
|
16533
16635
|
} else {
|
|
16534
16636
|
var richTextConfig = textConfig[i];
|
|
16535
|
-
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text.includes("\n")) {
|
|
16637
|
+
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
16536
16638
|
var textParts = richTextConfig.text.split("\n");
|
|
16537
16639
|
for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
16538
|
-
} else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
16640
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
16539
16641
|
}
|
|
16540
16642
|
var maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
16541
16643
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -20195,9 +20297,10 @@
|
|
|
20195
20297
|
key: "drawLinearAreaHighPerformance",
|
|
20196
20298
|
value: function drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
20197
20299
|
var _a, _b, _c, _d, _e;
|
|
20300
|
+
var points = area.attribute.points;
|
|
20301
|
+
if (points.length < 2) return;
|
|
20198
20302
|
context.beginPath();
|
|
20199
20303
|
var z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
|
|
20200
|
-
points = area.attribute.points,
|
|
20201
20304
|
startP = points[0];
|
|
20202
20305
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
20203
20306
|
for (var i = 1; i < points.length; i++) {
|
|
@@ -20374,6 +20477,7 @@
|
|
|
20374
20477
|
key: "_drawSegmentItem",
|
|
20375
20478
|
value: function _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
|
|
20376
20479
|
var _a, _b, _c, _d;
|
|
20480
|
+
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
20377
20481
|
var connectedType = attribute.connectedType,
|
|
20378
20482
|
connectedX = attribute.connectedX,
|
|
20379
20483
|
connectedY = attribute.connectedY,
|
|
@@ -20382,7 +20486,6 @@
|
|
|
20382
20486
|
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) {
|
|
20383
20487
|
return da.push(i);
|
|
20384
20488
|
}) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
20385
|
-
if (!cache) return;
|
|
20386
20489
|
context.beginPath();
|
|
20387
20490
|
var _area$attribute4 = area.attribute,
|
|
20388
20491
|
points = _area$attribute4.points,
|
|
@@ -21177,7 +21280,9 @@
|
|
|
21177
21280
|
value: function draw(image, renderService, drawContext) {
|
|
21178
21281
|
var url = image.attribute.image;
|
|
21179
21282
|
if (!url || !image.resources) return;
|
|
21180
|
-
|
|
21283
|
+
var res = image.resources.get(url);
|
|
21284
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
21285
|
+
if ("success" !== res.state) return;
|
|
21181
21286
|
var context = renderService.drawParams.context;
|
|
21182
21287
|
if (!context) return;
|
|
21183
21288
|
var imageAttribute = getTheme(image).image;
|
|
@@ -21218,151 +21323,386 @@
|
|
|
21218
21323
|
},
|
|
21219
21324
|
__metadata$$ = undefined && undefined.__metadata || function (k, v) {
|
|
21220
21325
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21221
|
-
},
|
|
21222
|
-
__param$E = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
21223
|
-
return function (target, key) {
|
|
21224
|
-
decorator(target, key, paramIndex);
|
|
21225
|
-
};
|
|
21226
21326
|
};
|
|
21227
|
-
var
|
|
21228
|
-
var
|
|
21229
|
-
|
|
21230
|
-
function
|
|
21231
|
-
_classCallCheck(this,
|
|
21232
|
-
this.
|
|
21327
|
+
var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
|
|
21328
|
+
var tempDirtyBounds = new AABBBounds();
|
|
21329
|
+
var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21330
|
+
function ShadowRootDrawItemInterceptorContribution() {
|
|
21331
|
+
_classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
|
|
21332
|
+
this.order = 1;
|
|
21233
21333
|
}
|
|
21234
|
-
_createClass(
|
|
21235
|
-
key: "
|
|
21236
|
-
value: function
|
|
21237
|
-
|
|
21238
|
-
updateBounds && this.renderTreeRoots.forEach(function (g) {
|
|
21239
|
-
_this._prepare(g, updateBounds);
|
|
21240
|
-
});
|
|
21241
|
-
}
|
|
21242
|
-
}, {
|
|
21243
|
-
key: "_prepare",
|
|
21244
|
-
value: function _prepare(g, updateBounds) {
|
|
21245
|
-
var _this2 = this;
|
|
21246
|
-
g.forEachChildren(function (g) {
|
|
21247
|
-
_this2._prepare(g, updateBounds);
|
|
21248
|
-
}), g.update({
|
|
21249
|
-
bounds: updateBounds,
|
|
21250
|
-
trans: !0
|
|
21251
|
-
});
|
|
21252
|
-
}
|
|
21253
|
-
}, {
|
|
21254
|
-
key: "prepareRenderList",
|
|
21255
|
-
value: function prepareRenderList() {}
|
|
21256
|
-
}, {
|
|
21257
|
-
key: "beforeDraw",
|
|
21258
|
-
value: function beforeDraw(params) {}
|
|
21259
|
-
}, {
|
|
21260
|
-
key: "draw",
|
|
21261
|
-
value: function draw(params) {
|
|
21262
|
-
this.drawContribution.draw(this, Object.assign({}, this.drawParams));
|
|
21334
|
+
_createClass(ShadowRootDrawItemInterceptorContribution, [{
|
|
21335
|
+
key: "afterDrawItem",
|
|
21336
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21337
|
+
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21263
21338
|
}
|
|
21264
21339
|
}, {
|
|
21265
|
-
key: "
|
|
21266
|
-
value: function
|
|
21267
|
-
|
|
21340
|
+
key: "beforeDrawItem",
|
|
21341
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21342
|
+
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21268
21343
|
}
|
|
21269
21344
|
}, {
|
|
21270
|
-
key: "
|
|
21271
|
-
value: function
|
|
21272
|
-
|
|
21273
|
-
var
|
|
21274
|
-
|
|
21345
|
+
key: "drawItem",
|
|
21346
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21347
|
+
if (!graphic.shadowRoot) return !1;
|
|
21348
|
+
var context = drawContext.context;
|
|
21349
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21350
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21351
|
+
var m = graphic.globalTransMatrix.getInverse();
|
|
21352
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21353
|
+
}
|
|
21354
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21275
21355
|
}
|
|
21276
21356
|
}]);
|
|
21277
|
-
return
|
|
21357
|
+
return ShadowRootDrawItemInterceptorContribution;
|
|
21278
21358
|
}();
|
|
21279
|
-
|
|
21280
|
-
|
|
21281
|
-
|
|
21282
|
-
bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
|
|
21283
|
-
});
|
|
21284
|
-
|
|
21285
|
-
var GraphicPicker = Symbol["for"]("GraphicPicker");
|
|
21286
|
-
var PickerService = Symbol["for"]("PickerService");
|
|
21287
|
-
var BoundsPicker = Symbol["for"]("BoundsPicker");
|
|
21288
|
-
var GlobalPickerService = Symbol["for"]("GlobalPickerService");
|
|
21289
|
-
|
|
21290
|
-
var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21291
|
-
var d,
|
|
21292
|
-
c = arguments.length,
|
|
21293
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21294
|
-
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);
|
|
21295
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21296
|
-
};
|
|
21297
|
-
var PickItemInterceptor = Symbol["for"]("PickItemInterceptor");
|
|
21298
|
-
exports.ShadowRootPickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21299
|
-
function ShadowRootPickItemInterceptorContribution() {
|
|
21300
|
-
_classCallCheck(this, ShadowRootPickItemInterceptorContribution);
|
|
21359
|
+
var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21360
|
+
function DebugDrawItemInterceptorContribution() {
|
|
21361
|
+
_classCallCheck(this, DebugDrawItemInterceptorContribution);
|
|
21301
21362
|
this.order = 1;
|
|
21302
21363
|
}
|
|
21303
|
-
_createClass(
|
|
21304
|
-
key: "
|
|
21305
|
-
value: function
|
|
21306
|
-
return graphic.attribute.
|
|
21307
|
-
}
|
|
21308
|
-
}, {
|
|
21309
|
-
key: "beforePickItem",
|
|
21310
|
-
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21311
|
-
return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
21364
|
+
_createClass(DebugDrawItemInterceptorContribution, [{
|
|
21365
|
+
key: "afterDrawItem",
|
|
21366
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21367
|
+
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21312
21368
|
}
|
|
21313
21369
|
}, {
|
|
21314
|
-
key: "
|
|
21315
|
-
value: function
|
|
21316
|
-
if (!graphic.
|
|
21317
|
-
var
|
|
21318
|
-
|
|
21319
|
-
|
|
21320
|
-
|
|
21321
|
-
context.highPerformanceSave();
|
|
21322
|
-
var g = graphic.shadowRoot,
|
|
21323
|
-
currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
|
|
21324
|
-
newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
|
|
21325
|
-
result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
21326
|
-
return context.highPerformanceRestore(), result;
|
|
21370
|
+
key: "drawItem",
|
|
21371
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21372
|
+
if (!graphic.attribute._debug_bounds) return !1;
|
|
21373
|
+
var context = drawContext.context;
|
|
21374
|
+
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21375
|
+
var b = graphic.AABBBounds;
|
|
21376
|
+
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;
|
|
21327
21377
|
}
|
|
21328
21378
|
}]);
|
|
21329
|
-
return
|
|
21379
|
+
return DebugDrawItemInterceptorContribution;
|
|
21330
21380
|
}();
|
|
21331
|
-
exports.
|
|
21332
|
-
|
|
21333
|
-
|
|
21334
|
-
|
|
21335
|
-
this.order = 1;
|
|
21381
|
+
exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21382
|
+
function CommonDrawItemInterceptorContribution() {
|
|
21383
|
+
_classCallCheck(this, CommonDrawItemInterceptorContribution);
|
|
21384
|
+
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21336
21385
|
}
|
|
21337
|
-
_createClass(
|
|
21338
|
-
key: "
|
|
21339
|
-
value: function
|
|
21340
|
-
var
|
|
21341
|
-
|
|
21342
|
-
|
|
21343
|
-
|
|
21344
|
-
|
|
21345
|
-
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21349
|
-
}
|
|
21350
|
-
return null;
|
|
21386
|
+
_createClass(CommonDrawItemInterceptorContribution, [{
|
|
21387
|
+
key: "afterDrawItem",
|
|
21388
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21389
|
+
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;
|
|
21390
|
+
return !1;
|
|
21391
|
+
}
|
|
21392
|
+
}, {
|
|
21393
|
+
key: "beforeDrawItem",
|
|
21394
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21395
|
+
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21396
|
+
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;
|
|
21397
|
+
return !1;
|
|
21351
21398
|
}
|
|
21352
21399
|
}]);
|
|
21353
|
-
return
|
|
21400
|
+
return CommonDrawItemInterceptorContribution;
|
|
21354
21401
|
}();
|
|
21355
|
-
exports.
|
|
21356
|
-
|
|
21357
|
-
function
|
|
21358
|
-
_classCallCheck(this,
|
|
21402
|
+
exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
|
|
21403
|
+
var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21404
|
+
function InteractiveDrawItemInterceptorContribution() {
|
|
21405
|
+
_classCallCheck(this, InteractiveDrawItemInterceptorContribution);
|
|
21359
21406
|
this.order = 1;
|
|
21360
21407
|
}
|
|
21361
|
-
_createClass(
|
|
21362
|
-
key: "
|
|
21363
|
-
value: function
|
|
21364
|
-
|
|
21365
|
-
|
|
21408
|
+
_createClass(InteractiveDrawItemInterceptorContribution, [{
|
|
21409
|
+
key: "beforeDrawItem",
|
|
21410
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21411
|
+
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21412
|
+
}
|
|
21413
|
+
}, {
|
|
21414
|
+
key: "beforeSetInteractive",
|
|
21415
|
+
value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21416
|
+
var interactiveGraphic = graphic.interactiveGraphic;
|
|
21417
|
+
if (graphic.attribute.globalZIndex) {
|
|
21418
|
+
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21419
|
+
globalZIndex: 0,
|
|
21420
|
+
zIndex: graphic.attribute.globalZIndex
|
|
21421
|
+
}, !1, {
|
|
21422
|
+
skipUpdateCallback: !0
|
|
21423
|
+
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21424
|
+
var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21425
|
+
if (interactiveLayer) {
|
|
21426
|
+
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21427
|
+
}
|
|
21428
|
+
return !0;
|
|
21429
|
+
}
|
|
21430
|
+
if (interactiveGraphic) {
|
|
21431
|
+
drawContext.stage.tryInitInteractiveLayer();
|
|
21432
|
+
var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21433
|
+
if (_interactiveLayer) {
|
|
21434
|
+
this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
|
|
21435
|
+
}
|
|
21436
|
+
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21437
|
+
}
|
|
21438
|
+
return !1;
|
|
21439
|
+
}
|
|
21440
|
+
}, {
|
|
21441
|
+
key: "beforeDrawInteractive",
|
|
21442
|
+
value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21443
|
+
var baseGraphic = graphic.baseGraphic;
|
|
21444
|
+
if (baseGraphic) {
|
|
21445
|
+
this.processing = !0;
|
|
21446
|
+
var context = drawContext.context;
|
|
21447
|
+
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;
|
|
21448
|
+
}
|
|
21449
|
+
return !1;
|
|
21450
|
+
}
|
|
21451
|
+
}, {
|
|
21452
|
+
key: "getShadowRoot",
|
|
21453
|
+
value: function getShadowRoot(interactiveLayer) {
|
|
21454
|
+
var _a;
|
|
21455
|
+
var group = interactiveLayer.getElementById("_interactive_group");
|
|
21456
|
+
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21457
|
+
}
|
|
21458
|
+
}]);
|
|
21459
|
+
return InteractiveDrawItemInterceptorContribution;
|
|
21460
|
+
}();
|
|
21461
|
+
var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
|
|
21462
|
+
function Canvas3DDrawItemInterceptor() {
|
|
21463
|
+
_classCallCheck(this, Canvas3DDrawItemInterceptor);
|
|
21464
|
+
this.order = 1;
|
|
21465
|
+
}
|
|
21466
|
+
_createClass(Canvas3DDrawItemInterceptor, [{
|
|
21467
|
+
key: "beforeDrawItem",
|
|
21468
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21469
|
+
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21470
|
+
drawContext.in3dInterceptor = !0;
|
|
21471
|
+
var _renderService$drawPa = renderService.drawParams,
|
|
21472
|
+
context = _renderService$drawPa.context,
|
|
21473
|
+
stage = _renderService$drawPa.stage;
|
|
21474
|
+
context.canvas;
|
|
21475
|
+
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21476
|
+
var m = context.currentMatrix;
|
|
21477
|
+
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21478
|
+
var matrix = mat4Allocate.allocate();
|
|
21479
|
+
mat3Tomat4(matrix, m);
|
|
21480
|
+
var lastModelMatrix = context.modelMatrix;
|
|
21481
|
+
if (lastModelMatrix) {
|
|
21482
|
+
if (matrix) {
|
|
21483
|
+
var _m = mat4Allocate.allocate();
|
|
21484
|
+
context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
|
|
21485
|
+
}
|
|
21486
|
+
} else context.modelMatrix = matrix;
|
|
21487
|
+
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21488
|
+
var isPie = !1,
|
|
21489
|
+
is3d = !1;
|
|
21490
|
+
if (graphic.forEachChildren(function (c) {
|
|
21491
|
+
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
21492
|
+
}), graphic.forEachChildren(function (c) {
|
|
21493
|
+
return is3d = !!c.findFace, !is3d;
|
|
21494
|
+
}), isPie) {
|
|
21495
|
+
var children = graphic.getChildren(),
|
|
21496
|
+
sortedChildren = _toConsumableArray(children);
|
|
21497
|
+
sortedChildren.sort(function (a, b) {
|
|
21498
|
+
var _a, _b, _c, _d;
|
|
21499
|
+
var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21500
|
+
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21501
|
+
for (; angle1 < 0;) angle1 += pi2;
|
|
21502
|
+
for (; angle2 < 0;) angle2 += pi2;
|
|
21503
|
+
return angle2 - angle1;
|
|
21504
|
+
}), sortedChildren.forEach(function (c) {
|
|
21505
|
+
c._next = null, c._prev = null;
|
|
21506
|
+
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
21507
|
+
graphic.appendChild(c);
|
|
21508
|
+
});
|
|
21509
|
+
var _m2 = graphic.parent.globalTransMatrix;
|
|
21510
|
+
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) {
|
|
21511
|
+
c._next = null, c._prev = null;
|
|
21512
|
+
}), children.forEach(function (c) {
|
|
21513
|
+
graphic.appendChild(c);
|
|
21514
|
+
});
|
|
21515
|
+
} else if (is3d) {
|
|
21516
|
+
var _children = graphic.getChildren(),
|
|
21517
|
+
zChildren = _children.map(function (g) {
|
|
21518
|
+
return {
|
|
21519
|
+
ave_z: g.findFace().vertices.map(function (v) {
|
|
21520
|
+
var _a;
|
|
21521
|
+
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21522
|
+
}).reduce(function (a, b) {
|
|
21523
|
+
return a + b;
|
|
21524
|
+
}, 0),
|
|
21525
|
+
g: g
|
|
21526
|
+
};
|
|
21527
|
+
});
|
|
21528
|
+
zChildren.sort(function (a, b) {
|
|
21529
|
+
return b.ave_z - a.ave_z;
|
|
21530
|
+
}), graphic.removeAllChild(), zChildren.forEach(function (i) {
|
|
21531
|
+
i.g._next = null, i.g._prev = null;
|
|
21532
|
+
}), graphic.update(), zChildren.forEach(function (i) {
|
|
21533
|
+
graphic.add(i.g);
|
|
21534
|
+
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
21535
|
+
g._next = null, g._prev = null;
|
|
21536
|
+
}), graphic.update(), _children.forEach(function (g) {
|
|
21537
|
+
graphic.add(g);
|
|
21538
|
+
});
|
|
21539
|
+
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21540
|
+
} else drawContribution.renderItem(graphic, drawContext);
|
|
21541
|
+
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21542
|
+
}
|
|
21543
|
+
}, {
|
|
21544
|
+
key: "initCanvasCtx",
|
|
21545
|
+
value: function initCanvasCtx(context) {
|
|
21546
|
+
context.setTransformForCurrent();
|
|
21547
|
+
}
|
|
21548
|
+
}]);
|
|
21549
|
+
return Canvas3DDrawItemInterceptor;
|
|
21550
|
+
}();
|
|
21551
|
+
|
|
21552
|
+
var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21553
|
+
var d,
|
|
21554
|
+
c = arguments.length,
|
|
21555
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21556
|
+
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);
|
|
21557
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21558
|
+
},
|
|
21559
|
+
__metadata$_ = undefined && undefined.__metadata || function (k, v) {
|
|
21560
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21561
|
+
},
|
|
21562
|
+
__param$E = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
21563
|
+
return function (target, key) {
|
|
21564
|
+
decorator(target, key, paramIndex);
|
|
21565
|
+
};
|
|
21566
|
+
};
|
|
21567
|
+
var RenderService = Symbol["for"]("RenderService");
|
|
21568
|
+
var BeforeRenderConstribution = Symbol["for"]("BeforeRenderConstribution");
|
|
21569
|
+
exports.DefaultRenderService = /*#__PURE__*/function () {
|
|
21570
|
+
function DefaultRenderService(drawContribution) {
|
|
21571
|
+
_classCallCheck(this, DefaultRenderService);
|
|
21572
|
+
this.drawContribution = drawContribution;
|
|
21573
|
+
}
|
|
21574
|
+
_createClass(DefaultRenderService, [{
|
|
21575
|
+
key: "prepare",
|
|
21576
|
+
value: function prepare(updateBounds) {
|
|
21577
|
+
var _this = this;
|
|
21578
|
+
updateBounds && this.renderTreeRoots.forEach(function (g) {
|
|
21579
|
+
_this._prepare(g, updateBounds);
|
|
21580
|
+
});
|
|
21581
|
+
}
|
|
21582
|
+
}, {
|
|
21583
|
+
key: "_prepare",
|
|
21584
|
+
value: function _prepare(g, updateBounds) {
|
|
21585
|
+
var _this2 = this;
|
|
21586
|
+
g.forEachChildren(function (g) {
|
|
21587
|
+
_this2._prepare(g, updateBounds);
|
|
21588
|
+
}), g.update({
|
|
21589
|
+
bounds: updateBounds,
|
|
21590
|
+
trans: !0
|
|
21591
|
+
});
|
|
21592
|
+
}
|
|
21593
|
+
}, {
|
|
21594
|
+
key: "prepareRenderList",
|
|
21595
|
+
value: function prepareRenderList() {}
|
|
21596
|
+
}, {
|
|
21597
|
+
key: "beforeDraw",
|
|
21598
|
+
value: function beforeDraw(params) {}
|
|
21599
|
+
}, {
|
|
21600
|
+
key: "draw",
|
|
21601
|
+
value: function draw(params) {
|
|
21602
|
+
this.drawContribution.draw(this, Object.assign({}, this.drawParams));
|
|
21603
|
+
}
|
|
21604
|
+
}, {
|
|
21605
|
+
key: "afterDraw",
|
|
21606
|
+
value: function afterDraw(params) {
|
|
21607
|
+
this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
|
|
21608
|
+
}
|
|
21609
|
+
}, {
|
|
21610
|
+
key: "render",
|
|
21611
|
+
value: function render(groups, params) {
|
|
21612
|
+
this.renderTreeRoots = groups, this.drawParams = params;
|
|
21613
|
+
var updateBounds = params.updateBounds;
|
|
21614
|
+
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
|
|
21615
|
+
}
|
|
21616
|
+
}]);
|
|
21617
|
+
return DefaultRenderService;
|
|
21618
|
+
}();
|
|
21619
|
+
exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
|
|
21620
|
+
|
|
21621
|
+
var renderModule$1 = new ContainerModule(function (bind) {
|
|
21622
|
+
bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
|
|
21623
|
+
});
|
|
21624
|
+
|
|
21625
|
+
var GraphicPicker = Symbol["for"]("GraphicPicker");
|
|
21626
|
+
var PickerService = Symbol["for"]("PickerService");
|
|
21627
|
+
var BoundsPicker = Symbol["for"]("BoundsPicker");
|
|
21628
|
+
var GlobalPickerService = Symbol["for"]("GlobalPickerService");
|
|
21629
|
+
|
|
21630
|
+
var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21631
|
+
var d,
|
|
21632
|
+
c = arguments.length,
|
|
21633
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21634
|
+
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);
|
|
21635
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21636
|
+
};
|
|
21637
|
+
var PickItemInterceptor = Symbol["for"]("PickItemInterceptor");
|
|
21638
|
+
exports.ShadowRootPickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21639
|
+
function ShadowRootPickItemInterceptorContribution() {
|
|
21640
|
+
_classCallCheck(this, ShadowRootPickItemInterceptorContribution);
|
|
21641
|
+
this.order = 1;
|
|
21642
|
+
}
|
|
21643
|
+
_createClass(ShadowRootPickItemInterceptorContribution, [{
|
|
21644
|
+
key: "afterPickItem",
|
|
21645
|
+
value: function afterPickItem(graphic, pickerService, point, pickParams, params) {
|
|
21646
|
+
return graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
21647
|
+
}
|
|
21648
|
+
}, {
|
|
21649
|
+
key: "beforePickItem",
|
|
21650
|
+
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21651
|
+
return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
21652
|
+
}
|
|
21653
|
+
}, {
|
|
21654
|
+
key: "_pickItem",
|
|
21655
|
+
value: function _pickItem(graphic, pickerService, point, pickParams, params) {
|
|
21656
|
+
if (!graphic.shadowRoot) return null;
|
|
21657
|
+
var _ref = params || {},
|
|
21658
|
+
parentMatrix = _ref.parentMatrix;
|
|
21659
|
+
if (!parentMatrix) return null;
|
|
21660
|
+
var context = pickerService.pickContext;
|
|
21661
|
+
context.highPerformanceSave();
|
|
21662
|
+
var g = graphic.shadowRoot,
|
|
21663
|
+
currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
|
|
21664
|
+
newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
|
|
21665
|
+
result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
21666
|
+
return context.highPerformanceRestore(), result;
|
|
21667
|
+
}
|
|
21668
|
+
}]);
|
|
21669
|
+
return ShadowRootPickItemInterceptorContribution;
|
|
21670
|
+
}();
|
|
21671
|
+
exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
|
|
21672
|
+
exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21673
|
+
function InteractivePickItemInterceptorContribution() {
|
|
21674
|
+
_classCallCheck(this, InteractivePickItemInterceptorContribution);
|
|
21675
|
+
this.order = 1;
|
|
21676
|
+
}
|
|
21677
|
+
_createClass(InteractivePickItemInterceptorContribution, [{
|
|
21678
|
+
key: "beforePickItem",
|
|
21679
|
+
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21680
|
+
var originGraphic = graphic.baseGraphic;
|
|
21681
|
+
if (originGraphic && originGraphic.parent) {
|
|
21682
|
+
var newPoint = new Point(point.x, point.y),
|
|
21683
|
+
context = pickerService.pickContext;
|
|
21684
|
+
context.highPerformanceSave();
|
|
21685
|
+
var parentMatrix = originGraphic.parent.globalTransMatrix;
|
|
21686
|
+
parentMatrix.transformPoint(newPoint, newPoint);
|
|
21687
|
+
var result = originGraphic.isContainer ? pickerService.pickGroup(originGraphic, newPoint.clone(), parentMatrix, pickParams) : pickerService.pickItem(originGraphic, newPoint.clone(), parentMatrix, pickParams);
|
|
21688
|
+
return context.highPerformanceRestore(), result;
|
|
21689
|
+
}
|
|
21690
|
+
return null;
|
|
21691
|
+
}
|
|
21692
|
+
}]);
|
|
21693
|
+
return InteractivePickItemInterceptorContribution;
|
|
21694
|
+
}();
|
|
21695
|
+
exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
|
|
21696
|
+
exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
|
|
21697
|
+
function Canvas3DPickItemInterceptor() {
|
|
21698
|
+
_classCallCheck(this, Canvas3DPickItemInterceptor);
|
|
21699
|
+
this.order = 1;
|
|
21700
|
+
}
|
|
21701
|
+
_createClass(Canvas3DPickItemInterceptor, [{
|
|
21702
|
+
key: "beforePickItem",
|
|
21703
|
+
value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
|
|
21704
|
+
if (!graphic.in3dMode || pickParams.in3dInterceptor) return null;
|
|
21705
|
+
var context = pickerService.pickContext,
|
|
21366
21706
|
stage = graphic.stage;
|
|
21367
21707
|
if (!context || !stage) return null;
|
|
21368
21708
|
if (pickParams.in3dInterceptor = !0, context.save(), this.initCanvasCtx(context), context.camera = stage.camera, graphic.isContainer) {
|
|
@@ -21429,7 +21769,7 @@
|
|
|
21429
21769
|
}]);
|
|
21430
21770
|
return Canvas3DPickItemInterceptor;
|
|
21431
21771
|
}();
|
|
21432
|
-
exports.Canvas3DPickItemInterceptor = __decorate$
|
|
21772
|
+
exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
|
|
21433
21773
|
|
|
21434
21774
|
var pickModule = new ContainerModule(function (bind, unbind, isBound) {
|
|
21435
21775
|
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);
|
|
@@ -21442,14 +21782,14 @@
|
|
|
21442
21782
|
var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
|
|
21443
21783
|
var PluginService = Symbol["for"]("PluginService");
|
|
21444
21784
|
|
|
21445
|
-
var __decorate$
|
|
21785
|
+
var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21446
21786
|
var d,
|
|
21447
21787
|
c = arguments.length,
|
|
21448
21788
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21449
21789
|
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);
|
|
21450
21790
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21451
21791
|
},
|
|
21452
|
-
__metadata$
|
|
21792
|
+
__metadata$Z = undefined && undefined.__metadata || function (k, v) {
|
|
21453
21793
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21454
21794
|
},
|
|
21455
21795
|
__param$D = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
@@ -21505,7 +21845,7 @@
|
|
|
21505
21845
|
}]);
|
|
21506
21846
|
return DefaultPluginService;
|
|
21507
21847
|
}();
|
|
21508
|
-
DefaultPluginService = __decorate$
|
|
21848
|
+
DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
|
|
21509
21849
|
|
|
21510
21850
|
var pluginModule = new ContainerModule(function (bind) {
|
|
21511
21851
|
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
@@ -21519,14 +21859,14 @@
|
|
|
21519
21859
|
bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
21520
21860
|
});
|
|
21521
21861
|
|
|
21522
|
-
var __decorate$
|
|
21862
|
+
var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21523
21863
|
var d,
|
|
21524
21864
|
c = arguments.length,
|
|
21525
21865
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21526
21866
|
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);
|
|
21527
21867
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21528
21868
|
},
|
|
21529
|
-
__metadata$
|
|
21869
|
+
__metadata$Y = undefined && undefined.__metadata || function (k, v) {
|
|
21530
21870
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21531
21871
|
};
|
|
21532
21872
|
var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21620,16 +21960,16 @@
|
|
|
21620
21960
|
}]);
|
|
21621
21961
|
return CanvasLayerHandlerContribution;
|
|
21622
21962
|
}();
|
|
21623
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
21963
|
+
CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
21624
21964
|
|
|
21625
|
-
var __decorate$
|
|
21965
|
+
var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21626
21966
|
var d,
|
|
21627
21967
|
c = arguments.length,
|
|
21628
21968
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21629
21969
|
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);
|
|
21630
21970
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21631
21971
|
},
|
|
21632
|
-
__metadata$
|
|
21972
|
+
__metadata$X = undefined && undefined.__metadata || function (k, v) {
|
|
21633
21973
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21634
21974
|
};
|
|
21635
21975
|
var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21687,16 +22027,16 @@
|
|
|
21687
22027
|
}]);
|
|
21688
22028
|
return EmptyLayerHandlerContribution;
|
|
21689
22029
|
}();
|
|
21690
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
22030
|
+
EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
21691
22031
|
|
|
21692
|
-
var __decorate$
|
|
22032
|
+
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21693
22033
|
var d,
|
|
21694
22034
|
c = arguments.length,
|
|
21695
22035
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21696
22036
|
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);
|
|
21697
22037
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21698
22038
|
},
|
|
21699
|
-
__metadata$
|
|
22039
|
+
__metadata$W = undefined && undefined.__metadata || function (k, v) {
|
|
21700
22040
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21701
22041
|
};
|
|
21702
22042
|
var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21742,10 +22082,10 @@
|
|
|
21742
22082
|
value: function render(group, params) {
|
|
21743
22083
|
var _a;
|
|
21744
22084
|
params.renderService.render(group, Object.assign(Object.assign({
|
|
21745
|
-
context: this.context
|
|
22085
|
+
context: this.context,
|
|
22086
|
+
viewBox: params.stage.window.getViewBox(),
|
|
22087
|
+
transMatrix: params.stage.window.getViewBoxTransform()
|
|
21746
22088
|
}, params), {
|
|
21747
|
-
x: 0,
|
|
21748
|
-
y: 0,
|
|
21749
22089
|
clear: null !== (_a = params.background) && void 0 !== _a ? _a : "#ffffff"
|
|
21750
22090
|
}));
|
|
21751
22091
|
}
|
|
@@ -21767,14 +22107,11 @@
|
|
|
21767
22107
|
value: function drawTo(target, group, params) {
|
|
21768
22108
|
var context = target.getContext(),
|
|
21769
22109
|
targetDpr = target.dpr,
|
|
21770
|
-
|
|
21771
|
-
x =
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
width = _params$width === void 0 ? this.layer.viewWidth : _params$width,
|
|
21776
|
-
_params$height = params.height,
|
|
21777
|
-
height = _params$height === void 0 ? this.layer.viewHeight : _params$height;
|
|
22110
|
+
viewBox = params.viewBox,
|
|
22111
|
+
x = viewBox.x1,
|
|
22112
|
+
y = viewBox.y1,
|
|
22113
|
+
width = viewBox.width(),
|
|
22114
|
+
height = viewBox.height();
|
|
21778
22115
|
context.nativeContext.save(), context.nativeContext.setTransform(targetDpr, 0, 0, targetDpr, 0, 0), params.clear && context.clearRect(x, y, width, height), context.drawImage(this.canvas.nativeCanvas, 0, 0, this.canvas.width, this.canvas.height, x, y, width, height), context.nativeContext.restore();
|
|
21779
22116
|
}
|
|
21780
22117
|
}, {
|
|
@@ -21783,7 +22120,7 @@
|
|
|
21783
22120
|
}]);
|
|
21784
22121
|
return OffscreenLayerHandlerContribution;
|
|
21785
22122
|
}();
|
|
21786
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
22123
|
+
OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
21787
22124
|
|
|
21788
22125
|
var layerHandlerModules = new ContainerModule(function (bind) {
|
|
21789
22126
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -21805,345 +22142,110 @@
|
|
|
21805
22142
|
function rejected(value) {
|
|
21806
22143
|
try {
|
|
21807
22144
|
step(generator["throw"](value));
|
|
21808
|
-
} catch (e) {
|
|
21809
|
-
reject(e);
|
|
21810
|
-
}
|
|
21811
|
-
}
|
|
21812
|
-
function step(result) {
|
|
21813
|
-
var value;
|
|
21814
|
-
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function (resolve) {
|
|
21815
|
-
resolve(value);
|
|
21816
|
-
})).then(fulfilled, rejected);
|
|
21817
|
-
}
|
|
21818
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21819
|
-
});
|
|
21820
|
-
};
|
|
21821
|
-
function foreach(graphic, defaultZIndex, cb) {
|
|
21822
|
-
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
21823
|
-
var sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
21824
|
-
var childMap = {},
|
|
21825
|
-
zIdxArray = [];
|
|
21826
|
-
var needSort = !1;
|
|
21827
|
-
if (sort3d) needSort = !0;else {
|
|
21828
|
-
var lastZIndex;
|
|
21829
|
-
graphic.forEachChildren(function (item, i) {
|
|
21830
|
-
var _item$attribute$zInde = item.attribute.zIndex,
|
|
21831
|
-
zIndex = _item$attribute$zInde === void 0 ? defaultZIndex : _item$attribute$zInde;
|
|
21832
|
-
if (0 === i) lastZIndex = zIndex;else if (lastZIndex !== zIndex) return needSort = !0, !0;
|
|
21833
|
-
return !1;
|
|
21834
|
-
}, reverse);
|
|
21835
|
-
}
|
|
21836
|
-
if (needSort) {
|
|
21837
|
-
graphic.forEachChildren(function (item) {
|
|
21838
|
-
var _item$attribute$zInde2 = item.attribute.zIndex,
|
|
21839
|
-
zIndex = _item$attribute$zInde2 === void 0 ? defaultZIndex : _item$attribute$zInde2;
|
|
21840
|
-
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
|
|
21841
|
-
}, reverse), zIdxArray.sort(function (a, b) {
|
|
21842
|
-
return reverse ? b - a : a - b;
|
|
21843
|
-
});
|
|
21844
|
-
var skip = !1;
|
|
21845
|
-
for (var i = 0; i < zIdxArray.length && !skip; i++) {
|
|
21846
|
-
var idx = zIdxArray[i],
|
|
21847
|
-
children = childMap[idx];
|
|
21848
|
-
sort3d && children.sort(function (a, b) {
|
|
21849
|
-
var _a, _b;
|
|
21850
|
-
return (reverse ? -1 : 1) * ((null !== (_a = b.attribute.z) && void 0 !== _a ? _a : 0) - (null !== (_b = a.attribute.z) && void 0 !== _b ? _b : 0));
|
|
21851
|
-
});
|
|
21852
|
-
for (var _i = 0; _i < children.length; _i++) if (cb(children[_i], _i)) {
|
|
21853
|
-
skip = !0;
|
|
21854
|
-
break;
|
|
21855
|
-
}
|
|
21856
|
-
}
|
|
21857
|
-
} else graphic.forEachChildren(cb, reverse);
|
|
21858
|
-
}
|
|
21859
|
-
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
21860
|
-
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
21861
|
-
return __awaiter$2(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
21862
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
21863
|
-
while (1) switch (_context.prev = _context.next) {
|
|
21864
|
-
case 0:
|
|
21865
|
-
_context.next = 2;
|
|
21866
|
-
return graphic.forEachChildrenAsync(cb, reverse);
|
|
21867
|
-
case 2:
|
|
21868
|
-
case "end":
|
|
21869
|
-
return _context.stop();
|
|
21870
|
-
}
|
|
21871
|
-
}, _callee);
|
|
21872
|
-
}));
|
|
21873
|
-
}
|
|
21874
|
-
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
21875
|
-
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
21876
|
-
var childMap = {},
|
|
21877
|
-
zIdxArray = [];
|
|
21878
|
-
var needSort = !1;
|
|
21879
|
-
graphic.forEachChildren(function (item, i) {
|
|
21880
|
-
var _item$attribute$zInde3 = item.attribute.zIndex,
|
|
21881
|
-
zIndex = _item$attribute$zInde3 === void 0 ? defaultZIndex : _item$attribute$zInde3;
|
|
21882
|
-
if (0 === i) ;else if (undefined !== zIndex) return needSort = !0, !0;
|
|
21883
|
-
return !1;
|
|
21884
|
-
}, reverse);
|
|
21885
|
-
var result = null,
|
|
21886
|
-
next = !1;
|
|
21887
|
-
if (needSort) {
|
|
21888
|
-
graphic.forEachChildren(function (item) {
|
|
21889
|
-
var _item$attribute$zInde4 = item.attribute.zIndex,
|
|
21890
|
-
zIndex = _item$attribute$zInde4 === void 0 ? defaultZIndex : _item$attribute$zInde4;
|
|
21891
|
-
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
|
|
21892
|
-
}, reverse), zIdxArray.sort(function (a, b) {
|
|
21893
|
-
return reverse ? b - a : a - b;
|
|
21894
|
-
});
|
|
21895
|
-
var skip = !1;
|
|
21896
|
-
for (var i = 0; i < zIdxArray.length && !skip; i++) {
|
|
21897
|
-
var idx = zIdxArray[i],
|
|
21898
|
-
children = childMap[idx];
|
|
21899
|
-
for (var _i2 = 0; _i2 < children.length; _i2++) {
|
|
21900
|
-
if (next) {
|
|
21901
|
-
skip = !0, result = children[_i2];
|
|
21902
|
-
break;
|
|
21903
|
-
}
|
|
21904
|
-
children[_i2]._uid !== id || (next = !0);
|
|
21905
|
-
}
|
|
21906
|
-
}
|
|
21907
|
-
} else graphic.forEachChildren(function (item) {
|
|
21908
|
-
return next ? (result = item, !0) : (item._uid === id && (next = !0), !1);
|
|
21909
|
-
}, reverse);
|
|
21910
|
-
return result;
|
|
21911
|
-
}
|
|
21912
|
-
|
|
21913
|
-
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21914
|
-
var d,
|
|
21915
|
-
c = arguments.length,
|
|
21916
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21917
|
-
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);
|
|
21918
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21919
|
-
},
|
|
21920
|
-
__metadata$W = undefined && undefined.__metadata || function (k, v) {
|
|
21921
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21922
|
-
};
|
|
21923
|
-
var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
|
|
21924
|
-
var tempDirtyBounds = new AABBBounds();
|
|
21925
|
-
var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21926
|
-
function ShadowRootDrawItemInterceptorContribution() {
|
|
21927
|
-
_classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
|
|
21928
|
-
this.order = 1;
|
|
21929
|
-
}
|
|
21930
|
-
_createClass(ShadowRootDrawItemInterceptorContribution, [{
|
|
21931
|
-
key: "afterDrawItem",
|
|
21932
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21933
|
-
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21934
|
-
}
|
|
21935
|
-
}, {
|
|
21936
|
-
key: "beforeDrawItem",
|
|
21937
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21938
|
-
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21939
|
-
}
|
|
21940
|
-
}, {
|
|
21941
|
-
key: "drawItem",
|
|
21942
|
-
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21943
|
-
if (!graphic.shadowRoot) return !1;
|
|
21944
|
-
var context = drawContext.context;
|
|
21945
|
-
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21946
|
-
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21947
|
-
var m = graphic.globalTransMatrix.getInverse();
|
|
21948
|
-
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21949
|
-
}
|
|
21950
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21951
|
-
}
|
|
21952
|
-
}]);
|
|
21953
|
-
return ShadowRootDrawItemInterceptorContribution;
|
|
21954
|
-
}();
|
|
21955
|
-
var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21956
|
-
function DebugDrawItemInterceptorContribution() {
|
|
21957
|
-
_classCallCheck(this, DebugDrawItemInterceptorContribution);
|
|
21958
|
-
this.order = 1;
|
|
21959
|
-
}
|
|
21960
|
-
_createClass(DebugDrawItemInterceptorContribution, [{
|
|
21961
|
-
key: "afterDrawItem",
|
|
21962
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21963
|
-
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21964
|
-
}
|
|
21965
|
-
}, {
|
|
21966
|
-
key: "drawItem",
|
|
21967
|
-
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21968
|
-
if (!graphic.attribute._debug_bounds) return !1;
|
|
21969
|
-
var context = drawContext.context;
|
|
21970
|
-
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21971
|
-
var b = graphic.AABBBounds;
|
|
21972
|
-
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;
|
|
21973
|
-
}
|
|
21974
|
-
}]);
|
|
21975
|
-
return DebugDrawItemInterceptorContribution;
|
|
21976
|
-
}();
|
|
21977
|
-
var CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21978
|
-
function CommonDrawItemInterceptorContribution() {
|
|
21979
|
-
_classCallCheck(this, CommonDrawItemInterceptorContribution);
|
|
21980
|
-
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21981
|
-
}
|
|
21982
|
-
_createClass(CommonDrawItemInterceptorContribution, [{
|
|
21983
|
-
key: "afterDrawItem",
|
|
21984
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21985
|
-
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;
|
|
21986
|
-
return !1;
|
|
21987
|
-
}
|
|
21988
|
-
}, {
|
|
21989
|
-
key: "beforeDrawItem",
|
|
21990
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21991
|
-
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21992
|
-
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;
|
|
21993
|
-
return !1;
|
|
21994
|
-
}
|
|
21995
|
-
}]);
|
|
21996
|
-
return CommonDrawItemInterceptorContribution;
|
|
21997
|
-
}();
|
|
21998
|
-
CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
21999
|
-
var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
22000
|
-
function InteractiveDrawItemInterceptorContribution() {
|
|
22001
|
-
_classCallCheck(this, InteractiveDrawItemInterceptorContribution);
|
|
22002
|
-
this.order = 1;
|
|
22003
|
-
}
|
|
22004
|
-
_createClass(InteractiveDrawItemInterceptorContribution, [{
|
|
22005
|
-
key: "beforeDrawItem",
|
|
22006
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
22007
|
-
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
22008
|
-
}
|
|
22009
|
-
}, {
|
|
22010
|
-
key: "beforeSetInteractive",
|
|
22011
|
-
value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
22012
|
-
var interactiveGraphic = graphic.interactiveGraphic;
|
|
22013
|
-
if (graphic.attribute.globalZIndex) {
|
|
22014
|
-
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
22015
|
-
globalZIndex: 0,
|
|
22016
|
-
zIndex: graphic.attribute.globalZIndex
|
|
22017
|
-
}, !1, {
|
|
22018
|
-
skipUpdateCallback: !0
|
|
22019
|
-
}), drawContext.stage.tryInitInteractiveLayer();
|
|
22020
|
-
var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
22021
|
-
if (interactiveLayer) {
|
|
22022
|
-
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
22023
|
-
}
|
|
22024
|
-
return !0;
|
|
22025
|
-
}
|
|
22026
|
-
if (interactiveGraphic) {
|
|
22027
|
-
drawContext.stage.tryInitInteractiveLayer();
|
|
22028
|
-
var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
22029
|
-
if (_interactiveLayer) {
|
|
22030
|
-
this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
|
|
22031
|
-
}
|
|
22032
|
-
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
22033
|
-
}
|
|
22034
|
-
return !1;
|
|
22035
|
-
}
|
|
22036
|
-
}, {
|
|
22037
|
-
key: "beforeDrawInteractive",
|
|
22038
|
-
value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
22039
|
-
var baseGraphic = graphic.baseGraphic;
|
|
22040
|
-
if (baseGraphic) {
|
|
22041
|
-
this.processing = !0;
|
|
22042
|
-
var context = drawContext.context;
|
|
22043
|
-
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;
|
|
22145
|
+
} catch (e) {
|
|
22146
|
+
reject(e);
|
|
22044
22147
|
}
|
|
22045
|
-
return !1;
|
|
22046
22148
|
}
|
|
22047
|
-
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
|
|
22052
|
-
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
22149
|
+
function step(result) {
|
|
22150
|
+
var value;
|
|
22151
|
+
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function (resolve) {
|
|
22152
|
+
resolve(value);
|
|
22153
|
+
})).then(fulfilled, rejected);
|
|
22053
22154
|
}
|
|
22054
|
-
|
|
22055
|
-
|
|
22056
|
-
}
|
|
22057
|
-
|
|
22058
|
-
|
|
22059
|
-
|
|
22060
|
-
|
|
22155
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22156
|
+
});
|
|
22157
|
+
};
|
|
22158
|
+
function foreach(graphic, defaultZIndex, cb) {
|
|
22159
|
+
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
22160
|
+
var sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
22161
|
+
var childMap = {},
|
|
22162
|
+
zIdxArray = [];
|
|
22163
|
+
var needSort = !1;
|
|
22164
|
+
if (sort3d) needSort = !0;else {
|
|
22165
|
+
var lastZIndex;
|
|
22166
|
+
graphic.forEachChildren(function (item, i) {
|
|
22167
|
+
var _item$attribute$zInde = item.attribute.zIndex,
|
|
22168
|
+
zIndex = _item$attribute$zInde === void 0 ? defaultZIndex : _item$attribute$zInde;
|
|
22169
|
+
if (0 === i) lastZIndex = zIndex;else if (lastZIndex !== zIndex) return needSort = !0, !0;
|
|
22170
|
+
return !1;
|
|
22171
|
+
}, reverse);
|
|
22061
22172
|
}
|
|
22062
|
-
|
|
22063
|
-
|
|
22064
|
-
|
|
22065
|
-
|
|
22066
|
-
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
|
|
22070
|
-
|
|
22071
|
-
|
|
22072
|
-
var
|
|
22073
|
-
|
|
22074
|
-
|
|
22075
|
-
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22080
|
-
|
|
22081
|
-
|
|
22082
|
-
} else context.modelMatrix = matrix;
|
|
22083
|
-
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
22084
|
-
var isPie = !1,
|
|
22085
|
-
is3d = !1;
|
|
22086
|
-
if (graphic.forEachChildren(function (c) {
|
|
22087
|
-
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
22088
|
-
}), graphic.forEachChildren(function (c) {
|
|
22089
|
-
return is3d = !!c.findFace, !is3d;
|
|
22090
|
-
}), isPie) {
|
|
22091
|
-
var children = graphic.getChildren(),
|
|
22092
|
-
sortedChildren = _toConsumableArray(children);
|
|
22093
|
-
sortedChildren.sort(function (a, b) {
|
|
22094
|
-
var _a, _b, _c, _d;
|
|
22095
|
-
var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
22096
|
-
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
22097
|
-
for (; angle1 < 0;) angle1 += pi2;
|
|
22098
|
-
for (; angle2 < 0;) angle2 += pi2;
|
|
22099
|
-
return angle2 - angle1;
|
|
22100
|
-
}), sortedChildren.forEach(function (c) {
|
|
22101
|
-
c._next = null, c._prev = null;
|
|
22102
|
-
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
22103
|
-
graphic.appendChild(c);
|
|
22104
|
-
});
|
|
22105
|
-
var _m2 = graphic.parent.globalTransMatrix;
|
|
22106
|
-
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) {
|
|
22107
|
-
c._next = null, c._prev = null;
|
|
22108
|
-
}), children.forEach(function (c) {
|
|
22109
|
-
graphic.appendChild(c);
|
|
22110
|
-
});
|
|
22111
|
-
} else if (is3d) {
|
|
22112
|
-
var _children = graphic.getChildren(),
|
|
22113
|
-
zChildren = _children.map(function (g) {
|
|
22114
|
-
return {
|
|
22115
|
-
ave_z: g.findFace().vertices.map(function (v) {
|
|
22116
|
-
var _a;
|
|
22117
|
-
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
22118
|
-
}).reduce(function (a, b) {
|
|
22119
|
-
return a + b;
|
|
22120
|
-
}, 0),
|
|
22121
|
-
g: g
|
|
22122
|
-
};
|
|
22123
|
-
});
|
|
22124
|
-
zChildren.sort(function (a, b) {
|
|
22125
|
-
return b.ave_z - a.ave_z;
|
|
22126
|
-
}), graphic.removeAllChild(), zChildren.forEach(function (i) {
|
|
22127
|
-
i.g._next = null, i.g._prev = null;
|
|
22128
|
-
}), graphic.update(), zChildren.forEach(function (i) {
|
|
22129
|
-
graphic.add(i.g);
|
|
22130
|
-
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
22131
|
-
g._next = null, g._prev = null;
|
|
22132
|
-
}), graphic.update(), _children.forEach(function (g) {
|
|
22133
|
-
graphic.add(g);
|
|
22134
|
-
});
|
|
22135
|
-
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
22136
|
-
} else drawContribution.renderItem(graphic, drawContext);
|
|
22137
|
-
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
22173
|
+
if (needSort) {
|
|
22174
|
+
graphic.forEachChildren(function (item) {
|
|
22175
|
+
var _item$attribute$zInde2 = item.attribute.zIndex,
|
|
22176
|
+
zIndex = _item$attribute$zInde2 === void 0 ? defaultZIndex : _item$attribute$zInde2;
|
|
22177
|
+
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
|
|
22178
|
+
}, reverse), zIdxArray.sort(function (a, b) {
|
|
22179
|
+
return reverse ? b - a : a - b;
|
|
22180
|
+
});
|
|
22181
|
+
var skip = !1;
|
|
22182
|
+
for (var i = 0; i < zIdxArray.length && !skip; i++) {
|
|
22183
|
+
var idx = zIdxArray[i],
|
|
22184
|
+
children = childMap[idx];
|
|
22185
|
+
sort3d && children.sort(function (a, b) {
|
|
22186
|
+
var _a, _b;
|
|
22187
|
+
return (reverse ? -1 : 1) * ((null !== (_a = b.attribute.z) && void 0 !== _a ? _a : 0) - (null !== (_b = a.attribute.z) && void 0 !== _b ? _b : 0));
|
|
22188
|
+
});
|
|
22189
|
+
for (var _i = 0; _i < children.length; _i++) if (cb(children[_i], _i)) {
|
|
22190
|
+
skip = !0;
|
|
22191
|
+
break;
|
|
22192
|
+
}
|
|
22138
22193
|
}
|
|
22139
|
-
},
|
|
22140
|
-
|
|
22141
|
-
|
|
22142
|
-
|
|
22194
|
+
} else graphic.forEachChildren(cb, reverse);
|
|
22195
|
+
}
|
|
22196
|
+
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
22197
|
+
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
22198
|
+
return __awaiter$2(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
22199
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
22200
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22201
|
+
case 0:
|
|
22202
|
+
_context.next = 2;
|
|
22203
|
+
return graphic.forEachChildrenAsync(cb, reverse);
|
|
22204
|
+
case 2:
|
|
22205
|
+
case "end":
|
|
22206
|
+
return _context.stop();
|
|
22207
|
+
}
|
|
22208
|
+
}, _callee);
|
|
22209
|
+
}));
|
|
22210
|
+
}
|
|
22211
|
+
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
22212
|
+
var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
22213
|
+
var childMap = {},
|
|
22214
|
+
zIdxArray = [];
|
|
22215
|
+
var needSort = !1;
|
|
22216
|
+
graphic.forEachChildren(function (item, i) {
|
|
22217
|
+
var _item$attribute$zInde3 = item.attribute.zIndex,
|
|
22218
|
+
zIndex = _item$attribute$zInde3 === void 0 ? defaultZIndex : _item$attribute$zInde3;
|
|
22219
|
+
if (0 === i) ;else if (undefined !== zIndex) return needSort = !0, !0;
|
|
22220
|
+
return !1;
|
|
22221
|
+
}, reverse);
|
|
22222
|
+
var result = null,
|
|
22223
|
+
next = !1;
|
|
22224
|
+
if (needSort) {
|
|
22225
|
+
graphic.forEachChildren(function (item) {
|
|
22226
|
+
var _item$attribute$zInde4 = item.attribute.zIndex,
|
|
22227
|
+
zIndex = _item$attribute$zInde4 === void 0 ? defaultZIndex : _item$attribute$zInde4;
|
|
22228
|
+
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
|
|
22229
|
+
}, reverse), zIdxArray.sort(function (a, b) {
|
|
22230
|
+
return reverse ? b - a : a - b;
|
|
22231
|
+
});
|
|
22232
|
+
var skip = !1;
|
|
22233
|
+
for (var i = 0; i < zIdxArray.length && !skip; i++) {
|
|
22234
|
+
var idx = zIdxArray[i],
|
|
22235
|
+
children = childMap[idx];
|
|
22236
|
+
for (var _i2 = 0; _i2 < children.length; _i2++) {
|
|
22237
|
+
if (next) {
|
|
22238
|
+
skip = !0, result = children[_i2];
|
|
22239
|
+
break;
|
|
22240
|
+
}
|
|
22241
|
+
children[_i2]._uid !== id || (next = !0);
|
|
22242
|
+
}
|
|
22143
22243
|
}
|
|
22144
|
-
}
|
|
22145
|
-
|
|
22146
|
-
|
|
22244
|
+
} else graphic.forEachChildren(function (item) {
|
|
22245
|
+
return next ? (result = item, !0) : (item._uid === id && (next = !0), !1);
|
|
22246
|
+
}, reverse);
|
|
22247
|
+
return result;
|
|
22248
|
+
}
|
|
22147
22249
|
|
|
22148
22250
|
var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
22149
22251
|
var d,
|
|
@@ -22190,33 +22292,21 @@
|
|
|
22190
22292
|
this.prepareForDraw(renderService, drawContext), drawContext.drawContribution = this, this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap, this.currentRenderService = renderService;
|
|
22191
22293
|
var context = drawContext.context,
|
|
22192
22294
|
stage = drawContext.stage,
|
|
22193
|
-
|
|
22194
|
-
|
|
22195
|
-
_drawContext$y = drawContext.y,
|
|
22196
|
-
y = _drawContext$y === void 0 ? 0 : _drawContext$y,
|
|
22197
|
-
width = drawContext.width,
|
|
22198
|
-
height = drawContext.height;
|
|
22295
|
+
viewBox = drawContext.viewBox,
|
|
22296
|
+
transMatrix = drawContext.transMatrix;
|
|
22199
22297
|
if (!context) return;
|
|
22200
|
-
|
|
22201
|
-
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
22202
|
-
var t = context.nativeContext.getTransform();
|
|
22203
|
-
context.setTransformFromMatrix(t, !0, 1);
|
|
22204
|
-
}
|
|
22205
|
-
} else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
22206
|
-
var dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
|
|
22298
|
+
var dirtyBounds = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());
|
|
22207
22299
|
if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
|
|
22208
22300
|
var b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
|
|
22209
22301
|
dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
|
|
22210
22302
|
}
|
|
22211
22303
|
var d = context.dpr % 1;
|
|
22212
|
-
(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)
|
|
22213
|
-
var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
22214
|
-
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) {
|
|
22304
|
+
(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), context.inuse = !0, context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(), context.setTransformForCurrent(!0), context.translate(viewBox.x1, viewBox.y1, !0), 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) {
|
|
22215
22305
|
var _a, _b;
|
|
22216
22306
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22217
22307
|
}).forEach(function (group) {
|
|
22218
22308
|
group.isContainer ? _this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : _this2.renderItem(group, drawContext);
|
|
22219
|
-
}), context.restore(), context.
|
|
22309
|
+
}), context.restore(), context.draw(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1;
|
|
22220
22310
|
}
|
|
22221
22311
|
}, {
|
|
22222
22312
|
key: "doRegister",
|
|
@@ -22304,7 +22394,7 @@
|
|
|
22304
22394
|
key: "getRenderContribution",
|
|
22305
22395
|
value: function getRenderContribution(graphic) {
|
|
22306
22396
|
var renderer;
|
|
22307
|
-
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
|
|
22397
|
+
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType, graphic)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
|
|
22308
22398
|
}
|
|
22309
22399
|
}, {
|
|
22310
22400
|
key: "renderItem",
|
|
@@ -22343,35 +22433,36 @@
|
|
|
22343
22433
|
}
|
|
22344
22434
|
}, {
|
|
22345
22435
|
key: "selectRenderByNumberType",
|
|
22346
|
-
value: function selectRenderByNumberType(type) {
|
|
22347
|
-
|
|
22436
|
+
value: function selectRenderByNumberType(type, graphic) {
|
|
22437
|
+
var data;
|
|
22438
|
+
if (graphic.attribute.renderStyle) {
|
|
22439
|
+
var currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);
|
|
22440
|
+
data = currentRenderMap && currentRenderMap.get(type);
|
|
22441
|
+
}
|
|
22442
|
+
return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
22348
22443
|
}
|
|
22349
22444
|
}, {
|
|
22350
22445
|
key: "clearScreen",
|
|
22351
22446
|
value: function clearScreen(renderService, context, drawContext) {
|
|
22352
22447
|
var _a, _b;
|
|
22353
|
-
var clear = drawContext.clear
|
|
22448
|
+
var clear = drawContext.clear,
|
|
22449
|
+
viewBox = drawContext.viewBox,
|
|
22450
|
+
width = viewBox.width(),
|
|
22451
|
+
height = viewBox.height();
|
|
22354
22452
|
if (clear) {
|
|
22355
|
-
|
|
22356
|
-
_drawContext$width = drawContext.width,
|
|
22357
|
-
width = _drawContext$width === void 0 ? canvas.width : _drawContext$width,
|
|
22358
|
-
_drawContext$height = drawContext.height,
|
|
22359
|
-
height = _drawContext$height === void 0 ? canvas.height : _drawContext$height,
|
|
22360
|
-
x = 0,
|
|
22361
|
-
y = 0;
|
|
22362
|
-
context.clearRect(x, y, width, height);
|
|
22453
|
+
context.clearRect(0, 0, width, height);
|
|
22363
22454
|
var stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
|
|
22364
22455
|
if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
|
|
22365
22456
|
var res = stage.resources.get(clear);
|
|
22366
|
-
res && "success" === res.state && res.data && context.drawImage(res.data,
|
|
22457
|
+
res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
|
|
22367
22458
|
} else context.fillStyle = createColor(context, clear, {
|
|
22368
22459
|
AABBBounds: {
|
|
22369
|
-
x1:
|
|
22370
|
-
y1:
|
|
22371
|
-
x2:
|
|
22372
|
-
y2:
|
|
22460
|
+
x1: 0,
|
|
22461
|
+
y1: 0,
|
|
22462
|
+
x2: 0 + width,
|
|
22463
|
+
y2: 0 + height
|
|
22373
22464
|
}
|
|
22374
|
-
}, 0, 0), context.fillRect(
|
|
22465
|
+
}, 0, 0), context.fillRect(0, 0, width, height);
|
|
22375
22466
|
}
|
|
22376
22467
|
}
|
|
22377
22468
|
}, {
|
|
@@ -22679,7 +22770,7 @@
|
|
|
22679
22770
|
value: function draw(renderService, drawContext) {
|
|
22680
22771
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
22681
22772
|
var _this2 = this;
|
|
22682
|
-
var skipDraw, context,
|
|
22773
|
+
var skipDraw, context, viewBox;
|
|
22683
22774
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
22684
22775
|
while (1) switch (_context.prev = _context.next) {
|
|
22685
22776
|
case 0:
|
|
@@ -22701,23 +22792,15 @@
|
|
|
22701
22792
|
return _context.abrupt("return");
|
|
22702
22793
|
case 8:
|
|
22703
22794
|
this.currentRenderService = renderService;
|
|
22704
|
-
context = drawContext.context,
|
|
22705
|
-
|
|
22706
|
-
|
|
22707
|
-
|
|
22708
|
-
|
|
22709
|
-
|
|
22710
|
-
|
|
22711
|
-
|
|
22712
|
-
|
|
22713
|
-
var _a, _b;
|
|
22714
|
-
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22715
|
-
}).forEach(function (group) {
|
|
22716
|
-
_this2.renderGroup(group, drawContext);
|
|
22717
|
-
}), this.hooks.completeDraw.tap("top-draw", function () {
|
|
22718
|
-
context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), _this2.rendering = !1;
|
|
22719
|
-
});
|
|
22720
|
-
}
|
|
22795
|
+
context = drawContext.context, viewBox = drawContext.viewBox;
|
|
22796
|
+
context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(viewBox.x1, viewBox.y1, !0), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
|
|
22797
|
+
var _a, _b;
|
|
22798
|
+
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22799
|
+
}).forEach(function (group) {
|
|
22800
|
+
_this2.renderGroup(group, drawContext);
|
|
22801
|
+
}), this.hooks.completeDraw.tap("top-draw", function () {
|
|
22802
|
+
context.restore(), context.restore(), context.draw(), context.inuse = !1, _this2.rendering = !1;
|
|
22803
|
+
}));
|
|
22721
22804
|
case 11:
|
|
22722
22805
|
case "end":
|
|
22723
22806
|
return _context.stop();
|
|
@@ -22992,7 +23075,7 @@
|
|
|
22992
23075
|
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);
|
|
22993
23076
|
|
|
22994
23077
|
var renderModule = new ContainerModule(function (bind) {
|
|
22995
|
-
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);
|
|
23078
|
+
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);
|
|
22996
23079
|
});
|
|
22997
23080
|
|
|
22998
23081
|
function load(container) {
|
|
@@ -23123,12 +23206,10 @@
|
|
|
23123
23206
|
if (!layer || !group.layer.subLayers) return;
|
|
23124
23207
|
var subLayer = group.layer.subLayers.get(group._uid);
|
|
23125
23208
|
subLayer && subLayer.drawContribution && subLayer.drawContribution.draw(stage.renderService, Object.assign({
|
|
23126
|
-
x: stage.x,
|
|
23127
|
-
y: stage.y,
|
|
23128
|
-
width: layer.viewWidth,
|
|
23129
|
-
height: layer.viewHeight,
|
|
23130
23209
|
stage: stage,
|
|
23131
23210
|
layer: layer,
|
|
23211
|
+
viewBox: stage.window.getViewBox(),
|
|
23212
|
+
transMatrix: stage.window.getViewBoxTransform(),
|
|
23132
23213
|
clear: "transparent",
|
|
23133
23214
|
renderService: stage.renderService,
|
|
23134
23215
|
updateBounds: !1,
|
|
@@ -23152,6 +23233,8 @@
|
|
|
23152
23233
|
var _this = this;
|
|
23153
23234
|
this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, function (stage) {
|
|
23154
23235
|
stage && stage === _this.pluginService.stage && _this.drawHTML(context.stage.renderService);
|
|
23236
|
+
}), application.graphicService.hooks.onRemove.tap(this.key, function (graphic) {
|
|
23237
|
+
_this.removeDom(graphic);
|
|
23155
23238
|
}), application.graphicService.hooks.onRelease.tap(this.key, function (graphic) {
|
|
23156
23239
|
_this.removeDom(graphic);
|
|
23157
23240
|
});
|
|
@@ -23208,26 +23291,27 @@
|
|
|
23208
23291
|
anchorType = _html$anchorType === void 0 ? "boundsLeftTop" : _html$anchorType;
|
|
23209
23292
|
graphic.bindDom || (graphic.bindDom = new Map());
|
|
23210
23293
|
var lastDom = graphic.bindDom.get(dom);
|
|
23211
|
-
|
|
23212
|
-
|
|
23213
|
-
|
|
23214
|
-
|
|
23215
|
-
|
|
23216
|
-
|
|
23217
|
-
|
|
23218
|
-
|
|
23219
|
-
|
|
23220
|
-
|
|
23221
|
-
|
|
23222
|
-
|
|
23223
|
-
|
|
23224
|
-
|
|
23225
|
-
|
|
23226
|
-
|
|
23227
|
-
|
|
23228
|
-
|
|
23229
|
-
|
|
23230
|
-
}
|
|
23294
|
+
var wrapGroup, nativeContainer;
|
|
23295
|
+
if (!lastDom || container && container !== lastDom.container) {
|
|
23296
|
+
var nativeDom;
|
|
23297
|
+
graphic.bindDom.forEach(function (_ref) {
|
|
23298
|
+
var wrapGroup = _ref.wrapGroup;
|
|
23299
|
+
application.global.removeDom(wrapGroup);
|
|
23300
|
+
}), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
|
|
23301
|
+
var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
|
|
23302
|
+
nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
|
|
23303
|
+
tagName: "div",
|
|
23304
|
+
width: width,
|
|
23305
|
+
height: height,
|
|
23306
|
+
style: style,
|
|
23307
|
+
parent: nativeContainer
|
|
23308
|
+
}), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
|
|
23309
|
+
dom: nativeDom,
|
|
23310
|
+
container: container,
|
|
23311
|
+
wrapGroup: wrapGroup
|
|
23312
|
+
}));
|
|
23313
|
+
} else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
|
|
23314
|
+
wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
|
|
23231
23315
|
var left = 0,
|
|
23232
23316
|
top = 0;
|
|
23233
23317
|
var b = graphic.globalAABBBounds;
|
|
@@ -23777,7 +23861,13 @@
|
|
|
23777
23861
|
_classCallCheck(this, Stage);
|
|
23778
23862
|
var _a;
|
|
23779
23863
|
_this = _super.call(this, {}), _this._onVisibleChange = function (visible) {
|
|
23780
|
-
|
|
23864
|
+
if (!(_this._skipRender < 0)) if (visible) {
|
|
23865
|
+
if (_this.dirtyBounds) {
|
|
23866
|
+
var b = _this.window.getViewBox();
|
|
23867
|
+
_this.dirtyBounds.setValue(b.x1, b.y1, b.width(), b.height());
|
|
23868
|
+
}
|
|
23869
|
+
_this._skipRender > 1 && _this.renderNextFrame(), _this._skipRender = 0;
|
|
23870
|
+
} else _this._skipRender = 1;
|
|
23781
23871
|
}, _this.beforeRender = function (stage) {
|
|
23782
23872
|
_this._beforeRender && _this._beforeRender(stage);
|
|
23783
23873
|
}, _this.afterRender = function (stage) {
|
|
@@ -23790,12 +23880,13 @@
|
|
|
23790
23880
|
}, _this.global = application.global, !_this.global.env && isBrowserEnv() && _this.global.setEnv("browser"), _this.window = container.get(VWindow), _this.renderService = container.get(RenderService), _this.pluginService = container.get(PluginService), _this.layerService = container.get(LayerService), _this.pluginService.active(_assertThisInitialized(_this), params), _this.window.create({
|
|
23791
23881
|
width: params.width,
|
|
23792
23882
|
height: params.height,
|
|
23883
|
+
viewBox: params.viewBox,
|
|
23793
23884
|
container: params.container,
|
|
23794
23885
|
dpr: params.dpr || _this.global.devicePixelRatio,
|
|
23795
23886
|
canvasControled: !1 !== params.canvasControled,
|
|
23796
23887
|
title: params.title || "",
|
|
23797
23888
|
canvas: params.canvas
|
|
23798
|
-
}), _this.
|
|
23889
|
+
}), _this.state = "normal", _this.renderCount = 0, _this.tryInitEventSystem(), _this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, _this.appendChild(_this.layerService.createLayer(_assertThisInitialized(_this), {
|
|
23799
23890
|
main: !0
|
|
23800
23891
|
})), _this.nextFrameRenderLayerSet = new Set(), _this.willNextFrameRender = !1, _this.stage = _assertThisInitialized(_this), _this.renderStyle = params.renderStyle, params.autoRender && _this.enableAutoRender(), !1 === params.disableDirtyBounds && _this.enableDirtyBounds(), params.enableHtmlAttribute && _this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && _this.enableLayout(), _this.hooks.beforeRender.tap("constructor", _this.beforeRender), _this.hooks.afterRender.tap("constructor", _this.afterRender), _this._beforeRender = params.beforeRender, _this._afterRender = params.afterRender, _this.ticker = params.ticker || defaultTicker, _this.supportInteractiveLayer = !1 !== params.interactiveLayer, _this.timeline = new DefaultTimeline(), _this.ticker.addTimeline(_this.timeline), _this.timeline.pause(), params.optimize || (params.optimize = {}), _this.optmize(params.optimize), params.background && isString$1(_this._background) && _this._background.includes("/") && _this.setAttributes({
|
|
23801
23892
|
background: _this._background
|
|
@@ -23805,26 +23896,28 @@
|
|
|
23805
23896
|
_createClass(Stage, [{
|
|
23806
23897
|
key: "viewBox",
|
|
23807
23898
|
get: function get() {
|
|
23808
|
-
return this.
|
|
23899
|
+
return this.window.getViewBox();
|
|
23809
23900
|
},
|
|
23810
23901
|
set: function set(b) {
|
|
23811
|
-
this.
|
|
23902
|
+
this.window.setViewBox(b);
|
|
23812
23903
|
}
|
|
23813
23904
|
}, {
|
|
23814
23905
|
key: "x",
|
|
23815
23906
|
get: function get() {
|
|
23816
|
-
return this.
|
|
23907
|
+
return this.window.getViewBox().x1;
|
|
23817
23908
|
},
|
|
23818
23909
|
set: function set(x) {
|
|
23819
|
-
|
|
23910
|
+
var b = this.window.getViewBox();
|
|
23911
|
+
b.translate(x - b.x1, 0), this.window.setViewBox(b);
|
|
23820
23912
|
}
|
|
23821
23913
|
}, {
|
|
23822
23914
|
key: "y",
|
|
23823
23915
|
get: function get() {
|
|
23824
|
-
return this.
|
|
23916
|
+
return this.window.getViewBox().y1;
|
|
23825
23917
|
},
|
|
23826
23918
|
set: function set(y) {
|
|
23827
|
-
|
|
23919
|
+
var b = this.window.getViewBox();
|
|
23920
|
+
b.translate(0, y - b.y1), this.window.setViewBox(b);
|
|
23828
23921
|
}
|
|
23829
23922
|
}, {
|
|
23830
23923
|
key: "width",
|
|
@@ -23837,7 +23930,7 @@
|
|
|
23837
23930
|
}, {
|
|
23838
23931
|
key: "viewWidth",
|
|
23839
23932
|
get: function get() {
|
|
23840
|
-
return this.
|
|
23933
|
+
return this.window.getViewBox().width();
|
|
23841
23934
|
},
|
|
23842
23935
|
set: function set(w) {
|
|
23843
23936
|
this.resizeView(w, this.viewHeight);
|
|
@@ -23845,7 +23938,7 @@
|
|
|
23845
23938
|
}, {
|
|
23846
23939
|
key: "viewHeight",
|
|
23847
23940
|
get: function get() {
|
|
23848
|
-
return this.
|
|
23941
|
+
return this.window.getViewBox().height();
|
|
23849
23942
|
},
|
|
23850
23943
|
set: function set(h) {
|
|
23851
23944
|
this.resizeView(this.viewWidth, h);
|
|
@@ -23885,6 +23978,16 @@
|
|
|
23885
23978
|
get: function get() {
|
|
23886
23979
|
return this._eventSystem;
|
|
23887
23980
|
}
|
|
23981
|
+
}, {
|
|
23982
|
+
key: "pauseRender",
|
|
23983
|
+
value: function pauseRender() {
|
|
23984
|
+
this._skipRender = -1;
|
|
23985
|
+
}
|
|
23986
|
+
}, {
|
|
23987
|
+
key: "resumeRender",
|
|
23988
|
+
value: function resumeRender() {
|
|
23989
|
+
this._skipRender = 0;
|
|
23990
|
+
}
|
|
23888
23991
|
}, {
|
|
23889
23992
|
key: "tryInitEventSystem",
|
|
23890
23993
|
value: function tryInitEventSystem() {
|
|
@@ -23894,22 +23997,7 @@
|
|
|
23894
23997
|
rootNode: this,
|
|
23895
23998
|
global: this.global,
|
|
23896
23999
|
supportsPointerEvents: this.params.supportsPointerEvents,
|
|
23897
|
-
supportsTouchEvents: this.params.supportsTouchEvents
|
|
23898
|
-
viewport: {
|
|
23899
|
-
viewBox: this._viewBox,
|
|
23900
|
-
get x() {
|
|
23901
|
-
return this.viewBox.x1;
|
|
23902
|
-
},
|
|
23903
|
-
get y() {
|
|
23904
|
-
return this.viewBox.y1;
|
|
23905
|
-
},
|
|
23906
|
-
get width() {
|
|
23907
|
-
return this.viewBox.width();
|
|
23908
|
-
},
|
|
23909
|
-
get height() {
|
|
23910
|
-
return this.viewBox.height();
|
|
23911
|
-
}
|
|
23912
|
-
}
|
|
24000
|
+
supportsTouchEvents: this.params.supportsTouchEvents
|
|
23913
24001
|
}, this.params.event)));
|
|
23914
24002
|
}
|
|
23915
24003
|
}, {
|
|
@@ -24109,7 +24197,7 @@
|
|
|
24109
24197
|
}, {
|
|
24110
24198
|
key: "tryUpdateAABBBounds",
|
|
24111
24199
|
value: function tryUpdateAABBBounds() {
|
|
24112
|
-
var viewBox = this.
|
|
24200
|
+
var viewBox = this.window.getViewBox();
|
|
24113
24201
|
return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
|
|
24114
24202
|
}
|
|
24115
24203
|
}, {
|
|
@@ -24149,14 +24237,14 @@
|
|
|
24149
24237
|
}, {
|
|
24150
24238
|
key: "clearViewBox",
|
|
24151
24239
|
value: function clearViewBox(color) {
|
|
24152
|
-
this.window.clearViewBox(
|
|
24240
|
+
this.window.clearViewBox(color);
|
|
24153
24241
|
}
|
|
24154
24242
|
}, {
|
|
24155
24243
|
key: "render",
|
|
24156
24244
|
value: function render(layers, params) {
|
|
24157
24245
|
this.ticker.start(), this.timeline.resume();
|
|
24158
24246
|
var state = this.state;
|
|
24159
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children
|
|
24247
|
+
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
24160
24248
|
}
|
|
24161
24249
|
}, {
|
|
24162
24250
|
key: "combineLayersToWindow",
|
|
@@ -24176,7 +24264,7 @@
|
|
|
24176
24264
|
value: function _doRenderInThisFrame() {
|
|
24177
24265
|
this.timeline.resume(), this.ticker.start();
|
|
24178
24266
|
var state = this.state;
|
|
24179
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.
|
|
24267
|
+
this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
24180
24268
|
}
|
|
24181
24269
|
}, {
|
|
24182
24270
|
key: "renderLayerList",
|
|
@@ -24191,14 +24279,17 @@
|
|
|
24191
24279
|
layer.renderCount > _this10.renderCount || (layer.renderCount = _this10.renderCount + 1, layer.render({
|
|
24192
24280
|
renderService: _this10.renderService,
|
|
24193
24281
|
background: layer === _this10.defaultLayer ? _this10.background : void 0,
|
|
24194
|
-
updateBounds: !(!_this10.dirtyBounds || _this10.dirtyBounds.empty())
|
|
24282
|
+
updateBounds: !(!_this10.dirtyBounds || _this10.dirtyBounds.empty()),
|
|
24283
|
+
viewBox: _this10.window.getViewBox(),
|
|
24284
|
+
transMatrix: _this10.window.getViewBoxTransform()
|
|
24195
24285
|
}, Object.assign({
|
|
24196
|
-
renderStyle: _this10.renderStyle
|
|
24197
|
-
keepMatrix: _this10.params.renderKeepMatrix
|
|
24286
|
+
renderStyle: _this10.renderStyle
|
|
24198
24287
|
}, params)));
|
|
24199
24288
|
}), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
|
|
24200
24289
|
renderService: this.renderService,
|
|
24201
|
-
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
|
|
24290
|
+
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
|
|
24291
|
+
viewBox: this.window.getViewBox(),
|
|
24292
|
+
transMatrix: this.window.getViewBoxTransform()
|
|
24202
24293
|
}, Object.assign({
|
|
24203
24294
|
renderStyle: this.renderStyle
|
|
24204
24295
|
}, params));
|
|
@@ -24213,9 +24304,9 @@
|
|
|
24213
24304
|
key: "resize",
|
|
24214
24305
|
value: function resize(w, h) {
|
|
24215
24306
|
var rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
24216
|
-
this.window.resize(w, h), this.forEachChildren(function (c) {
|
|
24307
|
+
this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(function (c) {
|
|
24217
24308
|
c.resize(w, h);
|
|
24218
|
-
}), this.
|
|
24309
|
+
}), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
|
|
24219
24310
|
}
|
|
24220
24311
|
}, {
|
|
24221
24312
|
key: "resizeView",
|
|
@@ -24298,50 +24389,44 @@
|
|
|
24298
24389
|
}
|
|
24299
24390
|
}, {
|
|
24300
24391
|
key: "renderTo",
|
|
24301
|
-
value: function renderTo(window
|
|
24392
|
+
value: function renderTo(window) {
|
|
24302
24393
|
var _this12 = this;
|
|
24303
24394
|
this.forEachChildren(function (layer, i) {
|
|
24304
|
-
layer.drawTo(window,
|
|
24395
|
+
layer.drawTo(window, {
|
|
24305
24396
|
renderService: _this12.renderService,
|
|
24397
|
+
viewBox: window.getViewBox(),
|
|
24398
|
+
transMatrix: window.getViewBoxTransform(),
|
|
24306
24399
|
background: layer === _this12.defaultLayer ? _this12.background : void 0,
|
|
24307
24400
|
clear: 0 === i,
|
|
24308
24401
|
updateBounds: !(!_this12.dirtyBounds || _this12.dirtyBounds.empty())
|
|
24309
|
-
})
|
|
24402
|
+
});
|
|
24310
24403
|
});
|
|
24311
24404
|
}
|
|
24312
24405
|
}, {
|
|
24313
24406
|
key: "renderToNewWindow",
|
|
24314
24407
|
value: function renderToNewWindow() {
|
|
24315
|
-
var fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
24316
24408
|
var viewBox = arguments.length > 1 ? arguments[1] : undefined;
|
|
24317
|
-
var window = container.get(VWindow)
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24409
|
+
var window = container.get(VWindow),
|
|
24410
|
+
x1 = viewBox ? -viewBox.x1 : 0,
|
|
24411
|
+
y1 = viewBox ? -viewBox.y1 : 0,
|
|
24412
|
+
x2 = viewBox ? viewBox.x2 : this.viewWidth,
|
|
24413
|
+
y2 = viewBox ? viewBox.y2 : this.viewHeight,
|
|
24414
|
+
width = viewBox ? viewBox.width() : this.viewWidth,
|
|
24415
|
+
height = viewBox ? viewBox.height() : this.viewHeight;
|
|
24416
|
+
return window.create({
|
|
24417
|
+
viewBox: {
|
|
24418
|
+
x1: x1,
|
|
24419
|
+
y1: y1,
|
|
24420
|
+
x2: x2,
|
|
24421
|
+
y2: y2
|
|
24422
|
+
},
|
|
24423
|
+
width: width,
|
|
24424
|
+
height: height,
|
|
24321
24425
|
dpr: this.window.dpr,
|
|
24322
24426
|
canvasControled: !0,
|
|
24323
24427
|
offscreen: !0,
|
|
24324
24428
|
title: ""
|
|
24325
|
-
});
|
|
24326
|
-
var width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x),
|
|
24327
|
-
height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);
|
|
24328
|
-
window.create({
|
|
24329
|
-
width: width,
|
|
24330
|
-
height: height,
|
|
24331
|
-
dpr: this.window.dpr,
|
|
24332
|
-
canvasControled: !0,
|
|
24333
|
-
offscreen: !0,
|
|
24334
|
-
title: ""
|
|
24335
|
-
});
|
|
24336
|
-
}
|
|
24337
|
-
var x = viewBox ? -viewBox.x1 : 0,
|
|
24338
|
-
y = viewBox ? -viewBox.y1 : 0;
|
|
24339
|
-
return this.renderTo(window, {
|
|
24340
|
-
x: x,
|
|
24341
|
-
y: y,
|
|
24342
|
-
width: viewBox ? viewBox.x2 : window.width,
|
|
24343
|
-
height: viewBox ? viewBox.y2 : window.height
|
|
24344
|
-
}), window;
|
|
24429
|
+
}), this.renderTo(window), window;
|
|
24345
24430
|
}
|
|
24346
24431
|
}, {
|
|
24347
24432
|
key: "toCanvas",
|
|
@@ -24381,7 +24466,7 @@
|
|
|
24381
24466
|
__metadata$S = undefined && undefined.__metadata || function (k, v) {
|
|
24382
24467
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
24383
24468
|
};
|
|
24384
|
-
var initMatrix
|
|
24469
|
+
var initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
|
|
24385
24470
|
globalPoint = {
|
|
24386
24471
|
x: 0,
|
|
24387
24472
|
y: 0
|
|
@@ -24389,7 +24474,7 @@
|
|
|
24389
24474
|
exports.EmptyContext2d = /*#__PURE__*/function () {
|
|
24390
24475
|
function EmptyContext2d(canvas, dpr) {
|
|
24391
24476
|
_classCallCheck(this, EmptyContext2d);
|
|
24392
|
-
this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D();
|
|
24477
|
+
this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D(), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
24393
24478
|
}
|
|
24394
24479
|
_createClass(EmptyContext2d, [{
|
|
24395
24480
|
key: "nativeContext",
|
|
@@ -24702,7 +24787,12 @@
|
|
|
24702
24787
|
value: function clearMatrix() {
|
|
24703
24788
|
var setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
24704
24789
|
var dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
24705
|
-
this.setTransformFromMatrix(initMatrix
|
|
24790
|
+
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
24791
|
+
}
|
|
24792
|
+
}, {
|
|
24793
|
+
key: "setClearMatrix",
|
|
24794
|
+
value: function setClearMatrix(a, b, c, d, e, f) {
|
|
24795
|
+
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
24706
24796
|
}
|
|
24707
24797
|
}, {
|
|
24708
24798
|
key: "onlyTranslate",
|
|
@@ -25017,7 +25107,7 @@
|
|
|
25017
25107
|
exports.BaseWindowHandlerContribution = /*#__PURE__*/function () {
|
|
25018
25108
|
function BaseWindowHandlerContribution() {
|
|
25019
25109
|
_classCallCheck(this, BaseWindowHandlerContribution);
|
|
25020
|
-
this._uid = Generator.GenAutoIncrementId();
|
|
25110
|
+
this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
25021
25111
|
}
|
|
25022
25112
|
_createClass(BaseWindowHandlerContribution, [{
|
|
25023
25113
|
key: "onChange",
|
|
@@ -25050,6 +25140,26 @@
|
|
|
25050
25140
|
left: 0
|
|
25051
25141
|
};
|
|
25052
25142
|
}
|
|
25143
|
+
}, {
|
|
25144
|
+
key: "setViewBox",
|
|
25145
|
+
value: function setViewBox(vb) {
|
|
25146
|
+
this.viewBox.setValue(vb.x1, vb.y1, vb.x2, vb.y2);
|
|
25147
|
+
}
|
|
25148
|
+
}, {
|
|
25149
|
+
key: "getViewBox",
|
|
25150
|
+
value: function getViewBox() {
|
|
25151
|
+
return this.viewBox;
|
|
25152
|
+
}
|
|
25153
|
+
}, {
|
|
25154
|
+
key: "setViewBoxTransform",
|
|
25155
|
+
value: function setViewBoxTransform(a, b, c, d, e, f) {
|
|
25156
|
+
this.modelMatrix.setValue(a, b, c, d, e, f);
|
|
25157
|
+
}
|
|
25158
|
+
}, {
|
|
25159
|
+
key: "getViewBoxTransform",
|
|
25160
|
+
value: function getViewBoxTransform() {
|
|
25161
|
+
return this.modelMatrix;
|
|
25162
|
+
}
|
|
25053
25163
|
}]);
|
|
25054
25164
|
return BaseWindowHandlerContribution;
|
|
25055
25165
|
}();
|
|
@@ -25090,23 +25200,14 @@
|
|
|
25090
25200
|
group: null
|
|
25091
25201
|
};
|
|
25092
25202
|
params.pickerService = this;
|
|
25093
|
-
var
|
|
25094
|
-
|
|
25095
|
-
if (
|
|
25096
|
-
|
|
25097
|
-
|
|
25098
|
-
}
|
|
25099
|
-
if (this.pickContext) if (params.keepMatrix) {
|
|
25100
|
-
if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
|
|
25101
|
-
var t = this.pickContext.nativeContext.getTransform();
|
|
25102
|
-
this.pickContext.setTransformFromMatrix(t, !0, 1);
|
|
25103
|
-
}
|
|
25104
|
-
} else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
|
|
25105
|
-
params.pickContext = this.pickContext;
|
|
25106
|
-
var parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
|
|
25203
|
+
var w = params.bounds.width(),
|
|
25204
|
+
h = params.bounds.height();
|
|
25205
|
+
if (!new AABBBounds().setValue(0, 0, w, h).containsPoint(point)) return result;
|
|
25206
|
+
this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
|
|
25207
|
+
var parentMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
25107
25208
|
var group;
|
|
25108
25209
|
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);
|
|
25109
|
-
if (result.graphic || (result.group = group), this.pickContext &&
|
|
25210
|
+
if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
|
|
25110
25211
|
var g = result.graphic;
|
|
25111
25212
|
for (; g.parent;) g = g.parent;
|
|
25112
25213
|
g.shadowHost && (result.params = {
|
|
@@ -29385,7 +29486,6 @@
|
|
|
29385
29486
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
29386
29487
|
};
|
|
29387
29488
|
var outP = [0, 0, 0],
|
|
29388
|
-
initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
|
|
29389
29489
|
addArcToBezierPath = function addArcToBezierPath(bezierPath, startAngle, endAngle, cx, cy, rx, ry, clockwise) {
|
|
29390
29490
|
if (clockwise) for (; endAngle > startAngle;) endAngle -= pi2;else for (; endAngle < startAngle;) endAngle += pi2;
|
|
29391
29491
|
var step = pi / 3 * (endAngle > startAngle ? 1 : -1);
|
|
@@ -29421,7 +29521,7 @@
|
|
|
29421
29521
|
}), this._clearShadowStyle = !1, this._clearFilterStyle = !1, this._clearGlobalCompositeOperationStyle = !1;
|
|
29422
29522
|
var context = canvas.nativeCanvas.getContext("2d");
|
|
29423
29523
|
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
29424
|
-
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
29524
|
+
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
29425
29525
|
}
|
|
29426
29526
|
_createClass(BrowserContext2d, [{
|
|
29427
29527
|
key: "fillStyle",
|
|
@@ -30057,7 +30157,12 @@
|
|
|
30057
30157
|
value: function clearMatrix() {
|
|
30058
30158
|
var setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
30059
30159
|
var dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
30060
|
-
this.setTransformFromMatrix(
|
|
30160
|
+
this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
|
|
30161
|
+
}
|
|
30162
|
+
}, {
|
|
30163
|
+
key: "setClearMatrix",
|
|
30164
|
+
value: function setClearMatrix(a, b, c, d, e, f) {
|
|
30165
|
+
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
30061
30166
|
}
|
|
30062
30167
|
}, {
|
|
30063
30168
|
key: "onlyTranslate",
|
|
@@ -30341,7 +30446,7 @@
|
|
|
30341
30446
|
function BrowserWindowHandlerContribution_1() {
|
|
30342
30447
|
var _this;
|
|
30343
30448
|
_classCallCheck(this, BrowserWindowHandlerContribution_1);
|
|
30344
|
-
_this = _super.call(this), _this.type = "browser", _this._canvasIsIntersecting = !0, _this.global = application.global;
|
|
30449
|
+
_this = _super.call(this), _this.type = "browser", _this._canvasIsIntersecting = !0, _this.global = application.global, _this.viewBox = new AABBBounds(), _this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
30345
30450
|
return _this;
|
|
30346
30451
|
}
|
|
30347
30452
|
_createClass(BrowserWindowHandlerContribution_1, [{
|
|
@@ -30522,8 +30627,9 @@
|
|
|
30522
30627
|
}
|
|
30523
30628
|
}, {
|
|
30524
30629
|
key: "clearViewBox",
|
|
30525
|
-
value: function clearViewBox(
|
|
30526
|
-
var
|
|
30630
|
+
value: function clearViewBox(color) {
|
|
30631
|
+
var vb = this.viewBox,
|
|
30632
|
+
context = this.getContext(),
|
|
30527
30633
|
dpr = this.getDpr();
|
|
30528
30634
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
30529
30635
|
}
|
|
@@ -31127,8 +31233,9 @@
|
|
|
31127
31233
|
}
|
|
31128
31234
|
}, {
|
|
31129
31235
|
key: "clearViewBox",
|
|
31130
|
-
value: function clearViewBox(
|
|
31131
|
-
var
|
|
31236
|
+
value: function clearViewBox(color) {
|
|
31237
|
+
var vb = this.viewBox,
|
|
31238
|
+
context = this.getContext(),
|
|
31132
31239
|
dpr = this.getDpr();
|
|
31133
31240
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
31134
31241
|
}
|
|
@@ -31775,8 +31882,9 @@
|
|
|
31775
31882
|
}
|
|
31776
31883
|
}, {
|
|
31777
31884
|
key: "clearViewBox",
|
|
31778
|
-
value: function clearViewBox(
|
|
31779
|
-
var
|
|
31885
|
+
value: function clearViewBox(color) {
|
|
31886
|
+
var vb = this.viewBox,
|
|
31887
|
+
context = this.getContext(),
|
|
31780
31888
|
dpr = this.getDpr();
|
|
31781
31889
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
31782
31890
|
}
|
|
@@ -32176,7 +32284,7 @@
|
|
|
32176
32284
|
}
|
|
32177
32285
|
}, {
|
|
32178
32286
|
key: "clearViewBox",
|
|
32179
|
-
value: function clearViewBox(
|
|
32287
|
+
value: function clearViewBox(color) {}
|
|
32180
32288
|
}]);
|
|
32181
32289
|
return NodeWindowHandlerContribution;
|
|
32182
32290
|
}(exports.BaseWindowHandlerContribution);
|
|
@@ -32706,8 +32814,9 @@
|
|
|
32706
32814
|
}
|
|
32707
32815
|
}, {
|
|
32708
32816
|
key: "clearViewBox",
|
|
32709
|
-
value: function clearViewBox(
|
|
32710
|
-
var
|
|
32817
|
+
value: function clearViewBox(color) {
|
|
32818
|
+
var vb = this.viewBox,
|
|
32819
|
+
context = this.getContext(),
|
|
32711
32820
|
dpr = this.getDpr();
|
|
32712
32821
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
32713
32822
|
}
|
|
@@ -33138,8 +33247,9 @@
|
|
|
33138
33247
|
}
|
|
33139
33248
|
}, {
|
|
33140
33249
|
key: "clearViewBox",
|
|
33141
|
-
value: function clearViewBox(
|
|
33142
|
-
var
|
|
33250
|
+
value: function clearViewBox(color) {
|
|
33251
|
+
var vb = this.viewBox,
|
|
33252
|
+
context = this.getContext(),
|
|
33143
33253
|
dpr = this.getDpr();
|
|
33144
33254
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
33145
33255
|
}
|
|
@@ -34980,7 +35090,7 @@
|
|
|
34980
35090
|
|
|
34981
35091
|
var roughModule = _roughModule;
|
|
34982
35092
|
|
|
34983
|
-
const version = "0.17.20-alpha.
|
|
35093
|
+
const version = "0.17.20-alpha.10";
|
|
34984
35094
|
preLoadAllModule();
|
|
34985
35095
|
if (isBrowserEnv()) {
|
|
34986
35096
|
loadBrowserEnv(container);
|
|
@@ -35031,6 +35141,7 @@
|
|
|
35031
35141
|
exports.BoundsContext = BoundsContext;
|
|
35032
35142
|
exports.BoundsPicker = BoundsPicker;
|
|
35033
35143
|
exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
|
|
35144
|
+
exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
|
|
35034
35145
|
exports.CanvasFactory = CanvasFactory;
|
|
35035
35146
|
exports.CanvasTextLayout = CanvasTextLayout;
|
|
35036
35147
|
exports.CbAnimate = CbAnimate;
|
|
@@ -35052,6 +35163,7 @@
|
|
|
35052
35163
|
exports.CustomEvent = CustomEvent;
|
|
35053
35164
|
exports.CustomPath2D = CustomPath2D;
|
|
35054
35165
|
exports.CustomSymbolClass = CustomSymbolClass;
|
|
35166
|
+
exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
|
|
35055
35167
|
exports.DefaultArcAllocate = DefaultArcAllocate;
|
|
35056
35168
|
exports.DefaultArcAttribute = DefaultArcAttribute;
|
|
35057
35169
|
exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
|
|
@@ -35105,6 +35217,7 @@
|
|
|
35105
35217
|
exports.DefaultTransform = DefaultTransform;
|
|
35106
35218
|
exports.DragNDrop = DragNDrop;
|
|
35107
35219
|
exports.DrawContribution = DrawContribution;
|
|
35220
|
+
exports.DrawItemInterceptor = DrawItemInterceptor;
|
|
35108
35221
|
exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
|
|
35109
35222
|
exports.EnvContribution = EnvContribution;
|
|
35110
35223
|
exports.EventManager = EventManager;
|
|
@@ -35143,6 +35256,7 @@
|
|
|
35143
35256
|
exports.IncreaseCount = IncreaseCount;
|
|
35144
35257
|
exports.IncrementalDrawContribution = IncrementalDrawContribution;
|
|
35145
35258
|
exports.InputText = InputText;
|
|
35259
|
+
exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
|
|
35146
35260
|
exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
|
|
35147
35261
|
exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
|
|
35148
35262
|
exports.Layer = Layer;
|
|
@@ -35204,6 +35318,7 @@
|
|
|
35204
35318
|
exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
|
|
35205
35319
|
exports.SegContext = SegContext;
|
|
35206
35320
|
exports.ShadowRoot = ShadowRoot;
|
|
35321
|
+
exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
|
|
35207
35322
|
exports.Stage = Stage;
|
|
35208
35323
|
exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
|
|
35209
35324
|
exports.Step = Step$1;
|