@visactor/vrender 0.17.20-alpha.1 → 0.17.20-alpha.2
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 +331 -271
- 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 +5 -5
package/dist/index.js
CHANGED
|
@@ -6974,7 +6974,10 @@
|
|
|
6974
6974
|
value: function removeAllChild() {
|
|
6975
6975
|
if (!this._idMap) return;
|
|
6976
6976
|
var child = this._firstChild;
|
|
6977
|
-
for (; child;)
|
|
6977
|
+
for (; child;) {
|
|
6978
|
+
var next = child._next;
|
|
6979
|
+
child.parent = null, child._prev = null, child._next = null, child = next;
|
|
6980
|
+
}
|
|
6978
6981
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
6979
6982
|
}
|
|
6980
6983
|
}, {
|
|
@@ -11358,15 +11361,7 @@
|
|
|
11358
11361
|
var data = ResourceLoader.cache.get(url);
|
|
11359
11362
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
|
|
11360
11363
|
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)));
|
|
11364
|
+
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
|
|
11370
11365
|
}
|
|
11371
11366
|
}, {
|
|
11372
11367
|
key: "GetSvg",
|
|
@@ -11400,10 +11395,68 @@
|
|
|
11400
11395
|
return data.data;
|
|
11401
11396
|
}));
|
|
11402
11397
|
}
|
|
11398
|
+
}, {
|
|
11399
|
+
key: "loading",
|
|
11400
|
+
value: function loading() {
|
|
11401
|
+
setTimeout(function () {
|
|
11402
|
+
if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
|
|
11403
|
+
ResourceLoader.isLoading = !0;
|
|
11404
|
+
var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
|
|
11405
|
+
promises = [];
|
|
11406
|
+
tasks.forEach(function (task) {
|
|
11407
|
+
var url = task.url,
|
|
11408
|
+
marks = task.marks,
|
|
11409
|
+
data = {
|
|
11410
|
+
type: "image",
|
|
11411
|
+
loadState: "init"
|
|
11412
|
+
};
|
|
11413
|
+
if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
|
|
11414
|
+
data.waitingMark = marks;
|
|
11415
|
+
var end = data.dataPromise.then(function (res) {
|
|
11416
|
+
var _a;
|
|
11417
|
+
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
|
|
11418
|
+
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
11419
|
+
});
|
|
11420
|
+
});
|
|
11421
|
+
promises.push(end);
|
|
11422
|
+
} else data.loadState = "fail", marks.forEach(function (mark) {
|
|
11423
|
+
return mark.imageLoadFail(url);
|
|
11424
|
+
});
|
|
11425
|
+
}), Promise.all(promises).then(function () {
|
|
11426
|
+
ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11427
|
+
})["catch"](function (error) {
|
|
11428
|
+
console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11429
|
+
});
|
|
11430
|
+
}
|
|
11431
|
+
}, 0);
|
|
11432
|
+
}
|
|
11433
|
+
}, {
|
|
11434
|
+
key: "loadImage",
|
|
11435
|
+
value: function loadImage(url, mark) {
|
|
11436
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11437
|
+
if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
|
|
11438
|
+
ResourceLoader.toLoadAueue.push({
|
|
11439
|
+
url: url,
|
|
11440
|
+
marks: [mark]
|
|
11441
|
+
}), ResourceLoader.loading();
|
|
11442
|
+
}
|
|
11443
|
+
}, {
|
|
11444
|
+
key: "improveImageLoading",
|
|
11445
|
+
value: function improveImageLoading(url) {
|
|
11446
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11447
|
+
if (-1 !== index) {
|
|
11448
|
+
var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
|
|
11449
|
+
ResourceLoader.toLoadAueue.unshift(elememt[0]);
|
|
11450
|
+
}
|
|
11451
|
+
}
|
|
11403
11452
|
}]);
|
|
11404
11453
|
return ResourceLoader;
|
|
11405
11454
|
}();
|
|
11406
|
-
|
|
11455
|
+
function getIndex(url, arr) {
|
|
11456
|
+
for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
|
|
11457
|
+
return -1;
|
|
11458
|
+
}
|
|
11459
|
+
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
11407
11460
|
|
|
11408
11461
|
var tempMatrix = new Matrix(),
|
|
11409
11462
|
tempBounds$1 = new AABBBounds();
|
|
@@ -12189,7 +12242,7 @@
|
|
|
12189
12242
|
data: "init",
|
|
12190
12243
|
state: null
|
|
12191
12244
|
};
|
|
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);
|
|
12245
|
+
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
12246
|
}
|
|
12194
12247
|
}, {
|
|
12195
12248
|
key: "imageLoadSuccess",
|
|
@@ -16532,10 +16585,10 @@
|
|
|
16532
16585
|
}
|
|
16533
16586
|
} else {
|
|
16534
16587
|
var richTextConfig = textConfig[i];
|
|
16535
|
-
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text.includes("\n")) {
|
|
16588
|
+
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
16536
16589
|
var textParts = richTextConfig.text.split("\n");
|
|
16537
16590
|
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));
|
|
16591
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
16539
16592
|
}
|
|
16540
16593
|
var maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
16541
16594
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -21177,7 +21230,9 @@
|
|
|
21177
21230
|
value: function draw(image, renderService, drawContext) {
|
|
21178
21231
|
var url = image.attribute.image;
|
|
21179
21232
|
if (!url || !image.resources) return;
|
|
21180
|
-
|
|
21233
|
+
var res = image.resources.get(url);
|
|
21234
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
21235
|
+
if ("success" !== res.state) return;
|
|
21181
21236
|
var context = renderService.drawParams.context;
|
|
21182
21237
|
if (!context) return;
|
|
21183
21238
|
var imageAttribute = getTheme(image).image;
|
|
@@ -21218,6 +21273,241 @@
|
|
|
21218
21273
|
},
|
|
21219
21274
|
__metadata$$ = undefined && undefined.__metadata || function (k, v) {
|
|
21220
21275
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21276
|
+
};
|
|
21277
|
+
var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
|
|
21278
|
+
var tempDirtyBounds = new AABBBounds();
|
|
21279
|
+
var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21280
|
+
function ShadowRootDrawItemInterceptorContribution() {
|
|
21281
|
+
_classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
|
|
21282
|
+
this.order = 1;
|
|
21283
|
+
}
|
|
21284
|
+
_createClass(ShadowRootDrawItemInterceptorContribution, [{
|
|
21285
|
+
key: "afterDrawItem",
|
|
21286
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21287
|
+
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21288
|
+
}
|
|
21289
|
+
}, {
|
|
21290
|
+
key: "beforeDrawItem",
|
|
21291
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21292
|
+
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21293
|
+
}
|
|
21294
|
+
}, {
|
|
21295
|
+
key: "drawItem",
|
|
21296
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21297
|
+
if (!graphic.shadowRoot) return !1;
|
|
21298
|
+
var context = drawContext.context;
|
|
21299
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21300
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21301
|
+
var m = graphic.globalTransMatrix.getInverse();
|
|
21302
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21303
|
+
}
|
|
21304
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21305
|
+
}
|
|
21306
|
+
}]);
|
|
21307
|
+
return ShadowRootDrawItemInterceptorContribution;
|
|
21308
|
+
}();
|
|
21309
|
+
var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21310
|
+
function DebugDrawItemInterceptorContribution() {
|
|
21311
|
+
_classCallCheck(this, DebugDrawItemInterceptorContribution);
|
|
21312
|
+
this.order = 1;
|
|
21313
|
+
}
|
|
21314
|
+
_createClass(DebugDrawItemInterceptorContribution, [{
|
|
21315
|
+
key: "afterDrawItem",
|
|
21316
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21317
|
+
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21318
|
+
}
|
|
21319
|
+
}, {
|
|
21320
|
+
key: "drawItem",
|
|
21321
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21322
|
+
if (!graphic.attribute._debug_bounds) return !1;
|
|
21323
|
+
var context = drawContext.context;
|
|
21324
|
+
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21325
|
+
var b = graphic.AABBBounds;
|
|
21326
|
+
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
|
+
}
|
|
21328
|
+
}]);
|
|
21329
|
+
return DebugDrawItemInterceptorContribution;
|
|
21330
|
+
}();
|
|
21331
|
+
exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21332
|
+
function CommonDrawItemInterceptorContribution() {
|
|
21333
|
+
_classCallCheck(this, CommonDrawItemInterceptorContribution);
|
|
21334
|
+
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21335
|
+
}
|
|
21336
|
+
_createClass(CommonDrawItemInterceptorContribution, [{
|
|
21337
|
+
key: "afterDrawItem",
|
|
21338
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21339
|
+
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;
|
|
21340
|
+
return !1;
|
|
21341
|
+
}
|
|
21342
|
+
}, {
|
|
21343
|
+
key: "beforeDrawItem",
|
|
21344
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21345
|
+
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21346
|
+
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;
|
|
21347
|
+
return !1;
|
|
21348
|
+
}
|
|
21349
|
+
}]);
|
|
21350
|
+
return CommonDrawItemInterceptorContribution;
|
|
21351
|
+
}();
|
|
21352
|
+
exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
|
|
21353
|
+
var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21354
|
+
function InteractiveDrawItemInterceptorContribution() {
|
|
21355
|
+
_classCallCheck(this, InteractiveDrawItemInterceptorContribution);
|
|
21356
|
+
this.order = 1;
|
|
21357
|
+
}
|
|
21358
|
+
_createClass(InteractiveDrawItemInterceptorContribution, [{
|
|
21359
|
+
key: "beforeDrawItem",
|
|
21360
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21361
|
+
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21362
|
+
}
|
|
21363
|
+
}, {
|
|
21364
|
+
key: "beforeSetInteractive",
|
|
21365
|
+
value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21366
|
+
var interactiveGraphic = graphic.interactiveGraphic;
|
|
21367
|
+
if (graphic.attribute.globalZIndex) {
|
|
21368
|
+
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21369
|
+
globalZIndex: 0,
|
|
21370
|
+
zIndex: graphic.attribute.globalZIndex
|
|
21371
|
+
}, !1, {
|
|
21372
|
+
skipUpdateCallback: !0
|
|
21373
|
+
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21374
|
+
var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21375
|
+
if (interactiveLayer) {
|
|
21376
|
+
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21377
|
+
}
|
|
21378
|
+
return !0;
|
|
21379
|
+
}
|
|
21380
|
+
if (interactiveGraphic) {
|
|
21381
|
+
drawContext.stage.tryInitInteractiveLayer();
|
|
21382
|
+
var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21383
|
+
if (_interactiveLayer) {
|
|
21384
|
+
this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
|
|
21385
|
+
}
|
|
21386
|
+
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21387
|
+
}
|
|
21388
|
+
return !1;
|
|
21389
|
+
}
|
|
21390
|
+
}, {
|
|
21391
|
+
key: "beforeDrawInteractive",
|
|
21392
|
+
value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21393
|
+
var baseGraphic = graphic.baseGraphic;
|
|
21394
|
+
if (baseGraphic) {
|
|
21395
|
+
this.processing = !0;
|
|
21396
|
+
var context = drawContext.context;
|
|
21397
|
+
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;
|
|
21398
|
+
}
|
|
21399
|
+
return !1;
|
|
21400
|
+
}
|
|
21401
|
+
}, {
|
|
21402
|
+
key: "getShadowRoot",
|
|
21403
|
+
value: function getShadowRoot(interactiveLayer) {
|
|
21404
|
+
var _a;
|
|
21405
|
+
var group = interactiveLayer.getElementById("_interactive_group");
|
|
21406
|
+
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21407
|
+
}
|
|
21408
|
+
}]);
|
|
21409
|
+
return InteractiveDrawItemInterceptorContribution;
|
|
21410
|
+
}();
|
|
21411
|
+
var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
|
|
21412
|
+
function Canvas3DDrawItemInterceptor() {
|
|
21413
|
+
_classCallCheck(this, Canvas3DDrawItemInterceptor);
|
|
21414
|
+
this.order = 1;
|
|
21415
|
+
}
|
|
21416
|
+
_createClass(Canvas3DDrawItemInterceptor, [{
|
|
21417
|
+
key: "beforeDrawItem",
|
|
21418
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21419
|
+
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21420
|
+
drawContext.in3dInterceptor = !0;
|
|
21421
|
+
var _renderService$drawPa = renderService.drawParams,
|
|
21422
|
+
context = _renderService$drawPa.context,
|
|
21423
|
+
stage = _renderService$drawPa.stage;
|
|
21424
|
+
context.canvas;
|
|
21425
|
+
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21426
|
+
var m = context.currentMatrix;
|
|
21427
|
+
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21428
|
+
var matrix = mat4Allocate.allocate();
|
|
21429
|
+
mat3Tomat4(matrix, m);
|
|
21430
|
+
var lastModelMatrix = context.modelMatrix;
|
|
21431
|
+
if (lastModelMatrix) {
|
|
21432
|
+
if (matrix) {
|
|
21433
|
+
var _m = mat4Allocate.allocate();
|
|
21434
|
+
context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
|
|
21435
|
+
}
|
|
21436
|
+
} else context.modelMatrix = matrix;
|
|
21437
|
+
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21438
|
+
var isPie = !1,
|
|
21439
|
+
is3d = !1;
|
|
21440
|
+
if (graphic.forEachChildren(function (c) {
|
|
21441
|
+
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
21442
|
+
}), graphic.forEachChildren(function (c) {
|
|
21443
|
+
return is3d = !!c.findFace, !is3d;
|
|
21444
|
+
}), isPie) {
|
|
21445
|
+
var children = graphic.getChildren(),
|
|
21446
|
+
sortedChildren = _toConsumableArray(children);
|
|
21447
|
+
sortedChildren.sort(function (a, b) {
|
|
21448
|
+
var _a, _b, _c, _d;
|
|
21449
|
+
var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21450
|
+
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21451
|
+
for (; angle1 < 0;) angle1 += pi2;
|
|
21452
|
+
for (; angle2 < 0;) angle2 += pi2;
|
|
21453
|
+
return angle2 - angle1;
|
|
21454
|
+
}), sortedChildren.forEach(function (c) {
|
|
21455
|
+
c._next = null, c._prev = null;
|
|
21456
|
+
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
21457
|
+
graphic.appendChild(c);
|
|
21458
|
+
});
|
|
21459
|
+
var _m2 = graphic.parent.globalTransMatrix;
|
|
21460
|
+
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) {
|
|
21461
|
+
c._next = null, c._prev = null;
|
|
21462
|
+
}), children.forEach(function (c) {
|
|
21463
|
+
graphic.appendChild(c);
|
|
21464
|
+
});
|
|
21465
|
+
} else if (is3d) {
|
|
21466
|
+
var _children = graphic.getChildren(),
|
|
21467
|
+
zChildren = _children.map(function (g) {
|
|
21468
|
+
return {
|
|
21469
|
+
ave_z: g.findFace().vertices.map(function (v) {
|
|
21470
|
+
var _a;
|
|
21471
|
+
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21472
|
+
}).reduce(function (a, b) {
|
|
21473
|
+
return a + b;
|
|
21474
|
+
}, 0),
|
|
21475
|
+
g: g
|
|
21476
|
+
};
|
|
21477
|
+
});
|
|
21478
|
+
zChildren.sort(function (a, b) {
|
|
21479
|
+
return b.ave_z - a.ave_z;
|
|
21480
|
+
}), graphic.removeAllChild(), zChildren.forEach(function (i) {
|
|
21481
|
+
i.g._next = null, i.g._prev = null;
|
|
21482
|
+
}), graphic.update(), zChildren.forEach(function (i) {
|
|
21483
|
+
graphic.add(i.g);
|
|
21484
|
+
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
21485
|
+
g._next = null, g._prev = null;
|
|
21486
|
+
}), graphic.update(), _children.forEach(function (g) {
|
|
21487
|
+
graphic.add(g);
|
|
21488
|
+
});
|
|
21489
|
+
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21490
|
+
} else drawContribution.renderItem(graphic, drawContext);
|
|
21491
|
+
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21492
|
+
}
|
|
21493
|
+
}, {
|
|
21494
|
+
key: "initCanvasCtx",
|
|
21495
|
+
value: function initCanvasCtx(context) {
|
|
21496
|
+
context.setTransformForCurrent();
|
|
21497
|
+
}
|
|
21498
|
+
}]);
|
|
21499
|
+
return Canvas3DDrawItemInterceptor;
|
|
21500
|
+
}();
|
|
21501
|
+
|
|
21502
|
+
var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21503
|
+
var d,
|
|
21504
|
+
c = arguments.length,
|
|
21505
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21506
|
+
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);
|
|
21507
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21508
|
+
},
|
|
21509
|
+
__metadata$_ = undefined && undefined.__metadata || function (k, v) {
|
|
21510
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21221
21511
|
},
|
|
21222
21512
|
__param$E = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
21223
21513
|
return function (target, key) {
|
|
@@ -21276,7 +21566,7 @@
|
|
|
21276
21566
|
}]);
|
|
21277
21567
|
return DefaultRenderService;
|
|
21278
21568
|
}();
|
|
21279
|
-
exports.DefaultRenderService = __decorate$
|
|
21569
|
+
exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
|
|
21280
21570
|
|
|
21281
21571
|
var renderModule$1 = new ContainerModule(function (bind) {
|
|
21282
21572
|
bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
|
|
@@ -21287,7 +21577,7 @@
|
|
|
21287
21577
|
var BoundsPicker = Symbol["for"]("BoundsPicker");
|
|
21288
21578
|
var GlobalPickerService = Symbol["for"]("GlobalPickerService");
|
|
21289
21579
|
|
|
21290
|
-
var __decorate$
|
|
21580
|
+
var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21291
21581
|
var d,
|
|
21292
21582
|
c = arguments.length,
|
|
21293
21583
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
@@ -21328,7 +21618,7 @@
|
|
|
21328
21618
|
}]);
|
|
21329
21619
|
return ShadowRootPickItemInterceptorContribution;
|
|
21330
21620
|
}();
|
|
21331
|
-
exports.ShadowRootPickItemInterceptorContribution = __decorate$
|
|
21621
|
+
exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
|
|
21332
21622
|
exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21333
21623
|
function InteractivePickItemInterceptorContribution() {
|
|
21334
21624
|
_classCallCheck(this, InteractivePickItemInterceptorContribution);
|
|
@@ -21352,7 +21642,7 @@
|
|
|
21352
21642
|
}]);
|
|
21353
21643
|
return InteractivePickItemInterceptorContribution;
|
|
21354
21644
|
}();
|
|
21355
|
-
exports.InteractivePickItemInterceptorContribution = __decorate$
|
|
21645
|
+
exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
|
|
21356
21646
|
exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
|
|
21357
21647
|
function Canvas3DPickItemInterceptor() {
|
|
21358
21648
|
_classCallCheck(this, Canvas3DPickItemInterceptor);
|
|
@@ -21429,7 +21719,7 @@
|
|
|
21429
21719
|
}]);
|
|
21430
21720
|
return Canvas3DPickItemInterceptor;
|
|
21431
21721
|
}();
|
|
21432
|
-
exports.Canvas3DPickItemInterceptor = __decorate$
|
|
21722
|
+
exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
|
|
21433
21723
|
|
|
21434
21724
|
var pickModule = new ContainerModule(function (bind, unbind, isBound) {
|
|
21435
21725
|
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 +21732,14 @@
|
|
|
21442
21732
|
var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
|
|
21443
21733
|
var PluginService = Symbol["for"]("PluginService");
|
|
21444
21734
|
|
|
21445
|
-
var __decorate$
|
|
21735
|
+
var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21446
21736
|
var d,
|
|
21447
21737
|
c = arguments.length,
|
|
21448
21738
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21449
21739
|
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
21740
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21451
21741
|
},
|
|
21452
|
-
__metadata$
|
|
21742
|
+
__metadata$Z = undefined && undefined.__metadata || function (k, v) {
|
|
21453
21743
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21454
21744
|
},
|
|
21455
21745
|
__param$D = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
@@ -21505,7 +21795,7 @@
|
|
|
21505
21795
|
}]);
|
|
21506
21796
|
return DefaultPluginService;
|
|
21507
21797
|
}();
|
|
21508
|
-
DefaultPluginService = __decorate$
|
|
21798
|
+
DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
|
|
21509
21799
|
|
|
21510
21800
|
var pluginModule = new ContainerModule(function (bind) {
|
|
21511
21801
|
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
@@ -21519,14 +21809,14 @@
|
|
|
21519
21809
|
bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
21520
21810
|
});
|
|
21521
21811
|
|
|
21522
|
-
var __decorate$
|
|
21812
|
+
var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21523
21813
|
var d,
|
|
21524
21814
|
c = arguments.length,
|
|
21525
21815
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21526
21816
|
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
21817
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21528
21818
|
},
|
|
21529
|
-
__metadata$
|
|
21819
|
+
__metadata$Y = undefined && undefined.__metadata || function (k, v) {
|
|
21530
21820
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21531
21821
|
};
|
|
21532
21822
|
var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21620,16 +21910,16 @@
|
|
|
21620
21910
|
}]);
|
|
21621
21911
|
return CanvasLayerHandlerContribution;
|
|
21622
21912
|
}();
|
|
21623
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
21913
|
+
CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
21624
21914
|
|
|
21625
|
-
var __decorate$
|
|
21915
|
+
var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21626
21916
|
var d,
|
|
21627
21917
|
c = arguments.length,
|
|
21628
21918
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21629
21919
|
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
21920
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21631
21921
|
},
|
|
21632
|
-
__metadata$
|
|
21922
|
+
__metadata$X = undefined && undefined.__metadata || function (k, v) {
|
|
21633
21923
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21634
21924
|
};
|
|
21635
21925
|
var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21687,16 +21977,16 @@
|
|
|
21687
21977
|
}]);
|
|
21688
21978
|
return EmptyLayerHandlerContribution;
|
|
21689
21979
|
}();
|
|
21690
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
21980
|
+
EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
21691
21981
|
|
|
21692
|
-
var __decorate$
|
|
21982
|
+
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21693
21983
|
var d,
|
|
21694
21984
|
c = arguments.length,
|
|
21695
21985
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21696
21986
|
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
21987
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21698
21988
|
},
|
|
21699
|
-
__metadata$
|
|
21989
|
+
__metadata$W = undefined && undefined.__metadata || function (k, v) {
|
|
21700
21990
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21701
21991
|
};
|
|
21702
21992
|
var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21783,7 +22073,7 @@
|
|
|
21783
22073
|
}]);
|
|
21784
22074
|
return OffscreenLayerHandlerContribution;
|
|
21785
22075
|
}();
|
|
21786
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
22076
|
+
OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
21787
22077
|
|
|
21788
22078
|
var layerHandlerModules = new ContainerModule(function (bind) {
|
|
21789
22079
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -21910,241 +22200,6 @@
|
|
|
21910
22200
|
return result;
|
|
21911
22201
|
}
|
|
21912
22202
|
|
|
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;
|
|
22044
|
-
}
|
|
22045
|
-
return !1;
|
|
22046
|
-
}
|
|
22047
|
-
}, {
|
|
22048
|
-
key: "getShadowRoot",
|
|
22049
|
-
value: function getShadowRoot(interactiveLayer) {
|
|
22050
|
-
var _a;
|
|
22051
|
-
var group = interactiveLayer.getElementById("_interactive_group");
|
|
22052
|
-
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
22053
|
-
}
|
|
22054
|
-
}]);
|
|
22055
|
-
return InteractiveDrawItemInterceptorContribution;
|
|
22056
|
-
}();
|
|
22057
|
-
var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
|
|
22058
|
-
function Canvas3DDrawItemInterceptor() {
|
|
22059
|
-
_classCallCheck(this, Canvas3DDrawItemInterceptor);
|
|
22060
|
-
this.order = 1;
|
|
22061
|
-
}
|
|
22062
|
-
_createClass(Canvas3DDrawItemInterceptor, [{
|
|
22063
|
-
key: "beforeDrawItem",
|
|
22064
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
22065
|
-
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
22066
|
-
drawContext.in3dInterceptor = !0;
|
|
22067
|
-
var _renderService$drawPa = renderService.drawParams,
|
|
22068
|
-
context = _renderService$drawPa.context,
|
|
22069
|
-
stage = _renderService$drawPa.stage;
|
|
22070
|
-
context.canvas;
|
|
22071
|
-
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
22072
|
-
var m = context.currentMatrix;
|
|
22073
|
-
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
22074
|
-
var matrix = mat4Allocate.allocate();
|
|
22075
|
-
mat3Tomat4(matrix, m);
|
|
22076
|
-
var lastModelMatrix = context.modelMatrix;
|
|
22077
|
-
if (lastModelMatrix) {
|
|
22078
|
-
if (matrix) {
|
|
22079
|
-
var _m = mat4Allocate.allocate();
|
|
22080
|
-
context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
|
|
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;
|
|
22138
|
-
}
|
|
22139
|
-
}, {
|
|
22140
|
-
key: "initCanvasCtx",
|
|
22141
|
-
value: function initCanvasCtx(context) {
|
|
22142
|
-
context.setTransformForCurrent();
|
|
22143
|
-
}
|
|
22144
|
-
}]);
|
|
22145
|
-
return Canvas3DDrawItemInterceptor;
|
|
22146
|
-
}();
|
|
22147
|
-
|
|
22148
22203
|
var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
22149
22204
|
var d,
|
|
22150
22205
|
c = arguments.length,
|
|
@@ -22211,7 +22266,7 @@
|
|
|
22211
22266
|
var d = context.dpr % 1;
|
|
22212
22267
|
(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
22268
|
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.
|
|
22269
|
+
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.clear(), this.backupDirtyBounds.clear()), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
|
|
22215
22270
|
var _a, _b;
|
|
22216
22271
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22217
22272
|
}).forEach(function (group) {
|
|
@@ -22274,7 +22329,7 @@
|
|
|
22274
22329
|
}, subLayers.set(group._uid, incrementalLayer));
|
|
22275
22330
|
var incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
|
|
22276
22331
|
idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
|
|
22277
|
-
idc.dirtyBounds.
|
|
22332
|
+
idc.dirtyBounds.clear(), idc.backupDirtyBounds.clear(), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
|
|
22278
22333
|
drawContribution: idc,
|
|
22279
22334
|
clear: "transparent",
|
|
22280
22335
|
layer: incrementalLayer.layer,
|
|
@@ -22992,7 +23047,7 @@
|
|
|
22992
23047
|
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
23048
|
|
|
22994
23049
|
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);
|
|
23050
|
+
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
23051
|
});
|
|
22997
23052
|
|
|
22998
23053
|
function load(container) {
|
|
@@ -34980,7 +35035,7 @@
|
|
|
34980
35035
|
|
|
34981
35036
|
var roughModule = _roughModule;
|
|
34982
35037
|
|
|
34983
|
-
const version = "0.17.20-alpha.
|
|
35038
|
+
const version = "0.17.20-alpha.2";
|
|
34984
35039
|
preLoadAllModule();
|
|
34985
35040
|
if (isBrowserEnv()) {
|
|
34986
35041
|
loadBrowserEnv(container);
|
|
@@ -35031,6 +35086,7 @@
|
|
|
35031
35086
|
exports.BoundsContext = BoundsContext;
|
|
35032
35087
|
exports.BoundsPicker = BoundsPicker;
|
|
35033
35088
|
exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
|
|
35089
|
+
exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
|
|
35034
35090
|
exports.CanvasFactory = CanvasFactory;
|
|
35035
35091
|
exports.CanvasTextLayout = CanvasTextLayout;
|
|
35036
35092
|
exports.CbAnimate = CbAnimate;
|
|
@@ -35052,6 +35108,7 @@
|
|
|
35052
35108
|
exports.CustomEvent = CustomEvent;
|
|
35053
35109
|
exports.CustomPath2D = CustomPath2D;
|
|
35054
35110
|
exports.CustomSymbolClass = CustomSymbolClass;
|
|
35111
|
+
exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
|
|
35055
35112
|
exports.DefaultArcAllocate = DefaultArcAllocate;
|
|
35056
35113
|
exports.DefaultArcAttribute = DefaultArcAttribute;
|
|
35057
35114
|
exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
|
|
@@ -35105,6 +35162,7 @@
|
|
|
35105
35162
|
exports.DefaultTransform = DefaultTransform;
|
|
35106
35163
|
exports.DragNDrop = DragNDrop;
|
|
35107
35164
|
exports.DrawContribution = DrawContribution;
|
|
35165
|
+
exports.DrawItemInterceptor = DrawItemInterceptor;
|
|
35108
35166
|
exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
|
|
35109
35167
|
exports.EnvContribution = EnvContribution;
|
|
35110
35168
|
exports.EventManager = EventManager;
|
|
@@ -35143,6 +35201,7 @@
|
|
|
35143
35201
|
exports.IncreaseCount = IncreaseCount;
|
|
35144
35202
|
exports.IncrementalDrawContribution = IncrementalDrawContribution;
|
|
35145
35203
|
exports.InputText = InputText;
|
|
35204
|
+
exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
|
|
35146
35205
|
exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
|
|
35147
35206
|
exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
|
|
35148
35207
|
exports.Layer = Layer;
|
|
@@ -35204,6 +35263,7 @@
|
|
|
35204
35263
|
exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
|
|
35205
35264
|
exports.SegContext = SegContext;
|
|
35206
35265
|
exports.ShadowRoot = ShadowRoot;
|
|
35266
|
+
exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
|
|
35207
35267
|
exports.Stage = Stage;
|
|
35208
35268
|
exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
|
|
35209
35269
|
exports.Step = Step$1;
|