@visactor/vrender-core 0.16.9-alpha.0 → 0.16.9
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/core/stage.js +4 -1
- package/cjs/core/stage.js.map +1 -1
- package/cjs/graphic/graphic.js +2 -2
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +7 -1
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/resource-loader/loader.js +1 -3
- package/cjs/resource-loader/loader.js.map +1 -1
- package/dist/index.js +22 -11
- package/dist/index.min.js +1 -1
- package/es/core/stage.js +4 -1
- package/es/core/stage.js.map +1 -1
- package/es/graphic/graphic.js +1 -1
- package/es/graphic/graphic.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.js +7 -1
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/resource-loader/loader.js +1 -3
- package/es/resource-loader/loader.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -11231,9 +11231,7 @@
|
|
|
11231
11231
|
(_a = data.waitingMark) === null || _a === void 0 ? void 0 : _a.push(mark);
|
|
11232
11232
|
}
|
|
11233
11233
|
else if (mark) {
|
|
11234
|
-
|
|
11235
|
-
mark.imageLoadSuccess(url, data.data);
|
|
11236
|
-
});
|
|
11234
|
+
mark.imageLoadSuccess(url, data.data);
|
|
11237
11235
|
}
|
|
11238
11236
|
}
|
|
11239
11237
|
else {
|
|
@@ -12314,12 +12312,12 @@
|
|
|
12314
12312
|
this.resources.set(url, cache);
|
|
12315
12313
|
if (typeof image === 'string') {
|
|
12316
12314
|
cache.state = 'loading';
|
|
12317
|
-
if (
|
|
12318
|
-
ResourceLoader.
|
|
12315
|
+
if (image.startsWith('<svg')) {
|
|
12316
|
+
ResourceLoader.GetSvg(image, this);
|
|
12319
12317
|
this.backgroundImg = this.backgroundImg || background;
|
|
12320
12318
|
}
|
|
12321
|
-
else if (image.
|
|
12322
|
-
ResourceLoader.
|
|
12319
|
+
else if (vutils.isValidUrl(image) || image.includes('/') || vutils.isBase64(image)) {
|
|
12320
|
+
ResourceLoader.GetImage(image, this);
|
|
12323
12321
|
this.backgroundImg = this.backgroundImg || background;
|
|
12324
12322
|
}
|
|
12325
12323
|
}
|
|
@@ -23642,6 +23640,7 @@
|
|
|
23642
23640
|
return this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
23643
23641
|
}
|
|
23644
23642
|
clearScreen(renderService, context, drawContext) {
|
|
23643
|
+
var _a;
|
|
23645
23644
|
const { clear } = drawContext;
|
|
23646
23645
|
if (clear) {
|
|
23647
23646
|
const canvas = context.getCanvas();
|
|
@@ -23649,10 +23648,19 @@
|
|
|
23649
23648
|
const x = 0;
|
|
23650
23649
|
const y = 0;
|
|
23651
23650
|
context.clearRect(x, y, width, height);
|
|
23652
|
-
|
|
23653
|
-
|
|
23654
|
-
|
|
23655
|
-
|
|
23651
|
+
const stage = (_a = renderService.drawParams) === null || _a === void 0 ? void 0 : _a.stage;
|
|
23652
|
+
if (stage && stage.backgroundImg && stage.resources) {
|
|
23653
|
+
const res = stage.resources.get(clear);
|
|
23654
|
+
if (res && res.state === 'success' && res.data) {
|
|
23655
|
+
context.drawImage(res.data, x, y, width, height);
|
|
23656
|
+
}
|
|
23657
|
+
}
|
|
23658
|
+
else {
|
|
23659
|
+
context.fillStyle = createColor(context, clear, {
|
|
23660
|
+
AABBBounds: { x1: x, y1: y, x2: x + width, y2: y + height }
|
|
23661
|
+
}, 0, 0);
|
|
23662
|
+
context.fillRect(x, y, width, height);
|
|
23663
|
+
}
|
|
23656
23664
|
}
|
|
23657
23665
|
}
|
|
23658
23666
|
afterDraw(renderService, drawParams) {
|
|
@@ -26105,6 +26113,9 @@
|
|
|
26105
26113
|
this.ticker.addTimeline(this.timeline);
|
|
26106
26114
|
this.timeline.pause();
|
|
26107
26115
|
this.optmize(params.optimize);
|
|
26116
|
+
if (this._background && vutils.isString(this._background)) {
|
|
26117
|
+
this.setAttributes({ background: this._background });
|
|
26118
|
+
}
|
|
26108
26119
|
}
|
|
26109
26120
|
optmize(params) {
|
|
26110
26121
|
this.optmizeRender(params === null || params === void 0 ? void 0 : params.skipRenderWithOutRange);
|