@visactor/vtable-plugins 1.19.4-alpha.2 → 1.19.4

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.
@@ -13092,7 +13092,7 @@
13092
13092
  return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
13093
13093
  }
13094
13094
  clearScreen(renderService, context, drawContext) {
13095
- var _a, _b;
13095
+ var _a, _b, _c;
13096
13096
  const {
13097
13097
  clear: clear,
13098
13098
  viewBox: viewBox
@@ -13100,9 +13100,9 @@
13100
13100
  width = viewBox.width(),
13101
13101
  height = viewBox.height();
13102
13102
  if (clear) {
13103
- context.clearRect(0, 0, width, height);
13104
- const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
13105
- if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
13103
+ context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
13104
+ const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
13105
+ if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
13106
13106
  const res = stage.resources.get(clear);
13107
13107
  res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
13108
13108
  } else context.fillStyle = createColor(context, clear, {
@@ -13632,6 +13632,8 @@
13632
13632
  this._beforeRender && this._beforeRender(stage);
13633
13633
  }, this.afterClearScreen = drawParams => {
13634
13634
  this._afterClearScreen && this._afterClearScreen(drawParams);
13635
+ }, this.afterClearRect = drawParams => {
13636
+ this._afterClearRect && this._afterClearRect(drawParams);
13635
13637
  }, this.afterRender = stage => {
13636
13638
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
13637
13639
  }, this.afterTickCb = () => {
@@ -13639,7 +13641,8 @@
13639
13641
  }, this.params = params, this.theme = new Theme(), this.hooks = {
13640
13642
  beforeRender: new SyncHook(["stage"]),
13641
13643
  afterRender: new SyncHook(["stage"]),
13642
- afterClearScreen: new SyncHook(["stage"])
13644
+ afterClearScreen: new SyncHook(["stage"]),
13645
+ afterClearRect: new SyncHook(["stage"])
13643
13646
  }, 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.graphicService = container.get(GraphicService), this.pluginService.active(this, params), this.window.create({
13644
13647
  width: params.width,
13645
13648
  height: params.height,
@@ -13651,7 +13654,7 @@
13651
13654
  canvas: params.canvas
13652
13655
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
13653
13656
  main: !0
13654
- })), 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.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
13657
+ })), 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.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
13655
13658
  tickRenderMode: "effect"
13656
13659
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
13657
13660
  background: this._background