@visactor/vrender 0.20.13-alpha.2 → 0.20.13
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 +10 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +58 -6
- package/dist/index.js +58 -6
- 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/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,17 +21,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.20.13
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
34
|
-
vrender_core_1.registerFlexLayoutPlugin)(), (0, vrender_core_1.registerViewTransform3dPlugin)(),
|
|
24
|
+
exports.version = "0.20.13", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
|
+
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
|
+
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
|
+
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
|
28
|
+
(0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(), (0, vrender_kits_2.registerImage)(),
|
|
29
|
+
(0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(), (0, vrender_kits_2.registerPolygon)(),
|
|
30
|
+
(0, vrender_kits_2.registerPyramid3d)(), (0, vrender_kits_2.registerRect)(), (0,
|
|
31
|
+
vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(), (0, vrender_kits_2.registerShadowRoot)(),
|
|
32
|
+
(0, vrender_kits_2.registerSymbol)(), (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(),
|
|
33
|
+
(0, vrender_core_1.registerFlexLayoutPlugin)(), (0, vrender_core_1.registerViewTransform3dPlugin)(),
|
|
35
34
|
(0, vrender_core_1.registerHtmlAttributePlugin)(), (0, vrender_core_1.registerReactAttributePlugin)(),
|
|
36
35
|
(0, vrender_core_1.registerDirectionalLight)(), (0, vrender_core_1.registerOrthoCamera)(),
|
|
37
36
|
__exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.20.13\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -4372,6 +4372,14 @@ let ATextMeasure = class {
|
|
|
4372
4372
|
return data;
|
|
4373
4373
|
}
|
|
4374
4374
|
_clipTextEnd(text, options, width, leftIdx, rightIdx) {
|
|
4375
|
+
if (leftIdx === rightIdx) {
|
|
4376
|
+
Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
|
|
4377
|
+
const subText = text.substring(0, rightIdx + 1);
|
|
4378
|
+
return {
|
|
4379
|
+
str: subText,
|
|
4380
|
+
width: this.measureTextWidth(subText, options)
|
|
4381
|
+
};
|
|
4382
|
+
}
|
|
4375
4383
|
const middleIdx = Math.floor((leftIdx + rightIdx) / 2),
|
|
4376
4384
|
subText = text.substring(0, middleIdx + 1),
|
|
4377
4385
|
strWidth = this.measureTextWidth(subText, options);
|
|
@@ -4405,7 +4413,7 @@ let ATextMeasure = class {
|
|
|
4405
4413
|
}
|
|
4406
4414
|
_clipTextStart(text, options, width, leftIdx, rightIdx) {
|
|
4407
4415
|
const middleIdx = Math.ceil((leftIdx + rightIdx) / 2),
|
|
4408
|
-
subText = text.substring(middleIdx - 1, text.length
|
|
4416
|
+
subText = text.substring(middleIdx - 1, text.length),
|
|
4409
4417
|
strWidth = this.measureTextWidth(subText, options);
|
|
4410
4418
|
let length;
|
|
4411
4419
|
if (strWidth > width) {
|
|
@@ -4413,18 +4421,18 @@ let ATextMeasure = class {
|
|
|
4413
4421
|
str: "",
|
|
4414
4422
|
width: 0
|
|
4415
4423
|
};
|
|
4416
|
-
const str = text.substring(middleIdx, text.length
|
|
4424
|
+
const str = text.substring(middleIdx, text.length);
|
|
4417
4425
|
return length = this.measureTextWidth(str, options), length <= width ? {
|
|
4418
4426
|
str: str,
|
|
4419
4427
|
width: length
|
|
4420
|
-
} : this._clipTextStart(text, options, width, middleIdx, text.length
|
|
4428
|
+
} : this._clipTextStart(text, options, width, middleIdx, text.length);
|
|
4421
4429
|
}
|
|
4422
4430
|
if (strWidth < width) {
|
|
4423
4431
|
if (middleIdx <= 0) return {
|
|
4424
4432
|
str: text,
|
|
4425
4433
|
width: this.measureTextWidth(text, options)
|
|
4426
4434
|
};
|
|
4427
|
-
const str = text.substring(middleIdx - 2, text.length
|
|
4435
|
+
const str = text.substring(middleIdx - 2, text.length);
|
|
4428
4436
|
return length = this.measureTextWidth(str, options), length >= width ? {
|
|
4429
4437
|
str: subText,
|
|
4430
4438
|
width: strWidth
|
|
@@ -18357,6 +18365,42 @@ class AutoRenderPlugin {
|
|
|
18357
18365
|
}
|
|
18358
18366
|
}
|
|
18359
18367
|
|
|
18368
|
+
class AutoRefreshPlugin {
|
|
18369
|
+
constructor() {
|
|
18370
|
+
this.name = "AutoRefreshPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.handleChange = graphic => {
|
|
18371
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === this.pluginService.stage && null != graphic.stage && graphic.stage.renderNextFrame();
|
|
18372
|
+
};
|
|
18373
|
+
}
|
|
18374
|
+
activate(context) {
|
|
18375
|
+
this.pluginService = context, this.dpr = application.global.devicePixelRatio, this.refresh();
|
|
18376
|
+
}
|
|
18377
|
+
refresh() {
|
|
18378
|
+
this._refreshByMediaQuery() || this._refreshByRaf();
|
|
18379
|
+
}
|
|
18380
|
+
_refreshByRaf() {
|
|
18381
|
+
const raf = application.global.getRequestAnimationFrame();
|
|
18382
|
+
this.rafId = raf(() => {
|
|
18383
|
+
application.global.devicePixelRatio !== this.dpr && (this.dpr = application.global.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0)), this.refresh();
|
|
18384
|
+
});
|
|
18385
|
+
}
|
|
18386
|
+
_refreshByMediaQuery() {
|
|
18387
|
+
try {
|
|
18388
|
+
const mqString = `(resolution: ${window.devicePixelRatio}dppx)`,
|
|
18389
|
+
updatePixelRatio = () => {
|
|
18390
|
+
window.devicePixelRatio !== this.dpr && (this.dpr = window.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0));
|
|
18391
|
+
};
|
|
18392
|
+
matchMedia(mqString).addEventListener("change", updatePixelRatio);
|
|
18393
|
+
} catch (err) {
|
|
18394
|
+
return !1;
|
|
18395
|
+
}
|
|
18396
|
+
return !0;
|
|
18397
|
+
}
|
|
18398
|
+
deactivate(context) {
|
|
18399
|
+
const craf = application.global.getCancelAnimationFrame();
|
|
18400
|
+
craf && this.rafId && craf(this.rafId);
|
|
18401
|
+
}
|
|
18402
|
+
}
|
|
18403
|
+
|
|
18360
18404
|
class IncrementalAutoRenderPlugin {
|
|
18361
18405
|
constructor() {
|
|
18362
18406
|
this.name = "IncrementalAutoRenderPlugin", this.activeEvent = "onRegister", this.nextFrameRenderGroupSet = new Set(), this.willNextFrameRender = !1, this.nextUserParams = {}, this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
|
|
@@ -18557,7 +18601,7 @@ class Stage extends Group {
|
|
|
18557
18601
|
canvas: params.canvas
|
|
18558
18602
|
}), 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(this, {
|
|
18559
18603
|
main: !0
|
|
18560
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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({
|
|
18604
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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({
|
|
18561
18605
|
background: this._background
|
|
18562
18606
|
});
|
|
18563
18607
|
}
|
|
@@ -18692,6 +18736,14 @@ class Stage extends Group {
|
|
|
18692
18736
|
this.pluginService.unRegister(plugin);
|
|
18693
18737
|
}));
|
|
18694
18738
|
}
|
|
18739
|
+
enableAutoRefresh() {
|
|
18740
|
+
this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
18741
|
+
}
|
|
18742
|
+
disableAutoRefresh() {
|
|
18743
|
+
this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
|
|
18744
|
+
this.pluginService.unRegister(plugin);
|
|
18745
|
+
}));
|
|
18746
|
+
}
|
|
18695
18747
|
enableIncrementalAutoRender() {
|
|
18696
18748
|
this.increaseAutoRender || (this.increaseAutoRender = !0, this.pluginService.register(new IncrementalAutoRenderPlugin()));
|
|
18697
18749
|
}
|
|
@@ -28543,7 +28595,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28543
28595
|
|
|
28544
28596
|
const roughModule = _roughModule;
|
|
28545
28597
|
|
|
28546
|
-
const version = "0.20.13
|
|
28598
|
+
const version = "0.20.13";
|
|
28547
28599
|
preLoadAllModule();
|
|
28548
28600
|
if (isBrowserEnv()) {
|
|
28549
28601
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -4378,6 +4378,14 @@
|
|
|
4378
4378
|
return data;
|
|
4379
4379
|
}
|
|
4380
4380
|
_clipTextEnd(text, options, width, leftIdx, rightIdx) {
|
|
4381
|
+
if (leftIdx === rightIdx) {
|
|
4382
|
+
Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
|
|
4383
|
+
const subText = text.substring(0, rightIdx + 1);
|
|
4384
|
+
return {
|
|
4385
|
+
str: subText,
|
|
4386
|
+
width: this.measureTextWidth(subText, options)
|
|
4387
|
+
};
|
|
4388
|
+
}
|
|
4381
4389
|
const middleIdx = Math.floor((leftIdx + rightIdx) / 2),
|
|
4382
4390
|
subText = text.substring(0, middleIdx + 1),
|
|
4383
4391
|
strWidth = this.measureTextWidth(subText, options);
|
|
@@ -4411,7 +4419,7 @@
|
|
|
4411
4419
|
}
|
|
4412
4420
|
_clipTextStart(text, options, width, leftIdx, rightIdx) {
|
|
4413
4421
|
const middleIdx = Math.ceil((leftIdx + rightIdx) / 2),
|
|
4414
|
-
subText = text.substring(middleIdx - 1, text.length
|
|
4422
|
+
subText = text.substring(middleIdx - 1, text.length),
|
|
4415
4423
|
strWidth = this.measureTextWidth(subText, options);
|
|
4416
4424
|
let length;
|
|
4417
4425
|
if (strWidth > width) {
|
|
@@ -4419,18 +4427,18 @@
|
|
|
4419
4427
|
str: "",
|
|
4420
4428
|
width: 0
|
|
4421
4429
|
};
|
|
4422
|
-
const str = text.substring(middleIdx, text.length
|
|
4430
|
+
const str = text.substring(middleIdx, text.length);
|
|
4423
4431
|
return length = this.measureTextWidth(str, options), length <= width ? {
|
|
4424
4432
|
str: str,
|
|
4425
4433
|
width: length
|
|
4426
|
-
} : this._clipTextStart(text, options, width, middleIdx, text.length
|
|
4434
|
+
} : this._clipTextStart(text, options, width, middleIdx, text.length);
|
|
4427
4435
|
}
|
|
4428
4436
|
if (strWidth < width) {
|
|
4429
4437
|
if (middleIdx <= 0) return {
|
|
4430
4438
|
str: text,
|
|
4431
4439
|
width: this.measureTextWidth(text, options)
|
|
4432
4440
|
};
|
|
4433
|
-
const str = text.substring(middleIdx - 2, text.length
|
|
4441
|
+
const str = text.substring(middleIdx - 2, text.length);
|
|
4434
4442
|
return length = this.measureTextWidth(str, options), length >= width ? {
|
|
4435
4443
|
str: subText,
|
|
4436
4444
|
width: strWidth
|
|
@@ -18363,6 +18371,42 @@
|
|
|
18363
18371
|
}
|
|
18364
18372
|
}
|
|
18365
18373
|
|
|
18374
|
+
class AutoRefreshPlugin {
|
|
18375
|
+
constructor() {
|
|
18376
|
+
this.name = "AutoRefreshPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.handleChange = graphic => {
|
|
18377
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === this.pluginService.stage && null != graphic.stage && graphic.stage.renderNextFrame();
|
|
18378
|
+
};
|
|
18379
|
+
}
|
|
18380
|
+
activate(context) {
|
|
18381
|
+
this.pluginService = context, this.dpr = application.global.devicePixelRatio, this.refresh();
|
|
18382
|
+
}
|
|
18383
|
+
refresh() {
|
|
18384
|
+
this._refreshByMediaQuery() || this._refreshByRaf();
|
|
18385
|
+
}
|
|
18386
|
+
_refreshByRaf() {
|
|
18387
|
+
const raf = application.global.getRequestAnimationFrame();
|
|
18388
|
+
this.rafId = raf(() => {
|
|
18389
|
+
application.global.devicePixelRatio !== this.dpr && (this.dpr = application.global.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0)), this.refresh();
|
|
18390
|
+
});
|
|
18391
|
+
}
|
|
18392
|
+
_refreshByMediaQuery() {
|
|
18393
|
+
try {
|
|
18394
|
+
const mqString = `(resolution: ${window.devicePixelRatio}dppx)`,
|
|
18395
|
+
updatePixelRatio = () => {
|
|
18396
|
+
window.devicePixelRatio !== this.dpr && (this.dpr = window.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0));
|
|
18397
|
+
};
|
|
18398
|
+
matchMedia(mqString).addEventListener("change", updatePixelRatio);
|
|
18399
|
+
} catch (err) {
|
|
18400
|
+
return !1;
|
|
18401
|
+
}
|
|
18402
|
+
return !0;
|
|
18403
|
+
}
|
|
18404
|
+
deactivate(context) {
|
|
18405
|
+
const craf = application.global.getCancelAnimationFrame();
|
|
18406
|
+
craf && this.rafId && craf(this.rafId);
|
|
18407
|
+
}
|
|
18408
|
+
}
|
|
18409
|
+
|
|
18366
18410
|
class IncrementalAutoRenderPlugin {
|
|
18367
18411
|
constructor() {
|
|
18368
18412
|
this.name = "IncrementalAutoRenderPlugin", this.activeEvent = "onRegister", this.nextFrameRenderGroupSet = new Set(), this.willNextFrameRender = !1, this.nextUserParams = {}, this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
|
|
@@ -18563,7 +18607,7 @@
|
|
|
18563
18607
|
canvas: params.canvas
|
|
18564
18608
|
}), 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(this, {
|
|
18565
18609
|
main: !0
|
|
18566
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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({
|
|
18610
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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({
|
|
18567
18611
|
background: this._background
|
|
18568
18612
|
});
|
|
18569
18613
|
}
|
|
@@ -18698,6 +18742,14 @@
|
|
|
18698
18742
|
this.pluginService.unRegister(plugin);
|
|
18699
18743
|
}));
|
|
18700
18744
|
}
|
|
18745
|
+
enableAutoRefresh() {
|
|
18746
|
+
this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
18747
|
+
}
|
|
18748
|
+
disableAutoRefresh() {
|
|
18749
|
+
this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
|
|
18750
|
+
this.pluginService.unRegister(plugin);
|
|
18751
|
+
}));
|
|
18752
|
+
}
|
|
18701
18753
|
enableIncrementalAutoRender() {
|
|
18702
18754
|
this.increaseAutoRender || (this.increaseAutoRender = !0, this.pluginService.register(new IncrementalAutoRenderPlugin()));
|
|
18703
18755
|
}
|
|
@@ -28549,7 +28601,7 @@
|
|
|
28549
28601
|
|
|
28550
28602
|
const roughModule = _roughModule;
|
|
28551
28603
|
|
|
28552
|
-
const version = "0.20.13
|
|
28604
|
+
const version = "0.20.13";
|
|
28553
28605
|
preLoadAllModule();
|
|
28554
28606
|
if (isBrowserEnv()) {
|
|
28555
28607
|
loadBrowserEnv(container);
|