@visactor/vrender 0.23.0-alpha.2 → 0.23.0-alpha.3

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/dist/index.js CHANGED
@@ -580,6 +580,25 @@
580
580
  const VGlobal = Symbol.for("VGlobal");
581
581
  const DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
582
582
 
583
+ class PerformanceRAF {
584
+ constructor() {
585
+ this.nextAnimationFrameCbs = [], this._rafHandle = null, this.runAnimationFrame = time => {
586
+ this._rafHandle = null;
587
+ const cbs = this.nextAnimationFrameCbs;
588
+ this.nextAnimationFrameCbs = [];
589
+ for (let i = 0; i < cbs.length; i++) cbs[i] && cbs[i](time);
590
+ }, this.tryRunAnimationFrameNextFrame = () => {
591
+ null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.length && (this._rafHandle = vglobal.getRequestAnimationFrame()(this.runAnimationFrame));
592
+ };
593
+ }
594
+ addAnimationFrameCb(callback) {
595
+ return this.nextAnimationFrameCbs.push(callback), this.tryRunAnimationFrameNextFrame(), this.nextAnimationFrameCbs.length - 1;
596
+ }
597
+ removeAnimationFrameCb(index) {
598
+ return index >= 0 && index < this.nextAnimationFrameCbs.length && (this.nextAnimationFrameCbs[index] = null, !0);
599
+ }
600
+ }
601
+
583
602
  var __decorate$1L = undefined && undefined.__decorate || function (decorators, target, key, desc) {
584
603
  var d,
585
604
  c = arguments.length,
@@ -664,7 +683,7 @@
664
683
  this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
665
684
  }
666
685
  constructor(contributions) {
667
- this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
686
+ this.contributions = contributions, this._isImageAnonymous = !0, this._performanceRAFList = [], this.id = Generator.GenAutoIncrementId(), this.hooks = {
668
687
  onSetEnv: new SyncHook(["lastEnv", "env", "global"])
669
688
  }, this.measureTextMethod = "native", this.optimizeVisible = !1;
670
689
  }
@@ -720,6 +739,16 @@
720
739
  getRequestAnimationFrame() {
721
740
  return this._env || this.setEnv("browser"), this.envContribution.getRequestAnimationFrame();
722
741
  }
742
+ getSpecifiedRequestAnimationFrame(id) {
743
+ this._env || this.setEnv("browser"), this._performanceRAFList[id] || (this._performanceRAFList[id] = new PerformanceRAF());
744
+ const performanceRAF = this._performanceRAFList[id];
745
+ return callback => performanceRAF.addAnimationFrameCb(callback);
746
+ }
747
+ getSpecifiedCancelAnimationFrame(id) {
748
+ if (this._env || this.setEnv("browser"), !this._performanceRAFList[id]) return () => !1;
749
+ const performanceRAF = this._performanceRAFList[id];
750
+ return handle => performanceRAF.removeAnimationFrameCb(handle);
751
+ }
723
752
  getCancelAnimationFrame() {
724
753
  return this._env || this.setEnv("browser"), this.envContribution.getCancelAnimationFrame();
725
754
  }
@@ -13822,7 +13851,7 @@
13822
13851
  const p = context.project(x, y, z);
13823
13852
  context.translate(p.x, p.y, !1), context.scale(scaleX, scaleY, !1), context.rotate(angle, !1), context.translate(-p.x, -p.y, !1), context.setTransformForCurrent();
13824
13853
  }
13825
- _draw(graphic, defaultAttr, computed3dMatrix, drawContext, params) {
13854
+ _draw(graphic, defaultAttr, computed3dMatrix, drawContext, params, themeAttribute) {
13826
13855
  const {
13827
13856
  context: context
13828
13857
  } = drawContext;
@@ -13839,7 +13868,7 @@
13839
13868
  z: z,
13840
13869
  lastModelMatrix: lastModelMatrix
13841
13870
  } = data;
13842
- this.z = z, this.drawPathProxy(graphic, context, x, y, drawContext, params) || (this.drawShape(graphic, context, x, y, drawContext, params), this.z = 0, context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix), context.highPerformanceRestore();
13871
+ this.z = z, this.drawPathProxy(graphic, context, x, y, drawContext, params) || (this.drawShape(graphic, context, x, y, drawContext, params, null, null, themeAttribute), this.z = 0, context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix), context.highPerformanceRestore();
13843
13872
  }
13844
13873
  }
13845
13874
 
@@ -13923,9 +13952,9 @@
13923
13952
  } else context.lineTo(cx + innerRadius * cos(innerStartAngle), cy + innerRadius * sin(innerStartAngle));
13924
13953
  return collapsedToLine;
13925
13954
  }
13926
- drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
13927
- const arcAttribute = getTheme(arc, null == params ? void 0 : params.theme).arc,
13928
- {
13955
+ drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb, arcAttribute) {
13956
+ arcAttribute = null != arcAttribute ? arcAttribute : getTheme(arc, null == params ? void 0 : params.theme).arc;
13957
+ const {
13929
13958
  fill = arcAttribute.fill,
13930
13959
  stroke = arcAttribute.stroke,
13931
13960
  x: originX = arcAttribute.x,
@@ -13966,17 +13995,7 @@
13966
13995
  isFullStroke: isFullStroke,
13967
13996
  stroke: arrayStroke
13968
13997
  } = parseStroke(stroke);
13969
- if (doFill || isFullStroke) {
13970
- context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
13971
- const _runFill = () => {
13972
- doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
13973
- },
13974
- _runStroke = () => {
13975
- doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()));
13976
- };
13977
- fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
13978
- }
13979
- if (!isFullStroke && doStroke) {
13998
+ if ((doFill || isFullStroke) && (context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), fillStrokeOrder ? (this._runStroke(arc, context, x, y, arcAttribute, doStroke, sVisible, strokeCb), this._runFill(arc, context, x, y, arcAttribute, doFill, fVisible, originX, originY, fillCb)) : (this._runFill(arc, context, x, y, arcAttribute, doFill, fVisible, originX, originY, fillCb), this._runStroke(arc, context, x, y, arcAttribute, doStroke, sVisible, strokeCb))), !isFullStroke && doStroke) {
13980
13999
  context.beginPath();
13981
14000
  drawArcPath$1(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
13982
14001
  beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
@@ -14012,9 +14031,15 @@
14012
14031
  }
14013
14032
  this.afterRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
14014
14033
  }
14034
+ _runFill(arc, context, x, y, arcAttribute, doFill, fVisible, originX, originY, fillCb) {
14035
+ doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
14036
+ }
14037
+ _runStroke(arc, context, x, y, arcAttribute, doStroke, sVisible, strokeCb) {
14038
+ doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
14039
+ }
14015
14040
  draw(arc, renderService, drawContext, params) {
14016
14041
  const arcAttribute = getTheme(arc, null == params ? void 0 : params.theme).arc;
14017
- this._draw(arc, arcAttribute, !1, drawContext, params);
14042
+ this._draw(arc, arcAttribute, !1, drawContext, params, arcAttribute);
14018
14043
  }
14019
14044
  };
14020
14045
  exports.DefaultCanvasArcRender = __decorate$1C([injectable(), __param$S(0, inject(ContributionProvider)), __param$S(0, named(ArcRenderContribution)), __metadata$1e("design:paramtypes", [Object])], exports.DefaultCanvasArcRender);
@@ -14725,26 +14750,25 @@
14725
14750
  constructor(rectRenderContribitions) {
14726
14751
  super(), this.rectRenderContribitions = rectRenderContribitions, this.type = "rect", this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution], this.init(rectRenderContribitions);
14727
14752
  }
14728
- drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
14729
- var _a;
14730
- const rectAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(rect, null == params ? void 0 : params.theme).rect,
14731
- {
14732
- fill = rectAttribute.fill,
14733
- background: background,
14734
- stroke = rectAttribute.stroke,
14735
- cornerRadius = rectAttribute.cornerRadius,
14736
- cornerType = rectAttribute.cornerType,
14737
- opacity = rectAttribute.opacity,
14738
- fillOpacity = rectAttribute.fillOpacity,
14739
- lineWidth = rectAttribute.lineWidth,
14740
- strokeOpacity = rectAttribute.strokeOpacity,
14741
- visible = rectAttribute.visible,
14742
- x1: x1,
14743
- y1: y1,
14744
- x: originX = rectAttribute.x,
14745
- y: originY = rectAttribute.y,
14746
- fillStrokeOrder = rectAttribute.fillStrokeOrder
14747
- } = rect.attribute;
14753
+ drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb, rectAttribute) {
14754
+ rectAttribute = null != rectAttribute ? rectAttribute : getTheme(rect, null == params ? void 0 : params.theme).rect;
14755
+ const {
14756
+ fill = rectAttribute.fill,
14757
+ background: background,
14758
+ stroke = rectAttribute.stroke,
14759
+ cornerRadius = rectAttribute.cornerRadius,
14760
+ cornerType = rectAttribute.cornerType,
14761
+ opacity = rectAttribute.opacity,
14762
+ fillOpacity = rectAttribute.fillOpacity,
14763
+ lineWidth = rectAttribute.lineWidth,
14764
+ strokeOpacity = rectAttribute.strokeOpacity,
14765
+ visible = rectAttribute.visible,
14766
+ x1: x1,
14767
+ y1: y1,
14768
+ x: originX = rectAttribute.x,
14769
+ y: originY = rectAttribute.y,
14770
+ fillStrokeOrder = rectAttribute.fillStrokeOrder
14771
+ } = rect.attribute;
14748
14772
  let {
14749
14773
  width: width,
14750
14774
  height: height
@@ -14762,18 +14786,17 @@
14762
14786
  doFill: doFill,
14763
14787
  doStroke: doStroke
14764
14788
  };
14765
- context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
14766
- const _runFill = () => {
14767
- doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
14768
- },
14769
- _runStroke = () => {
14770
- doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
14771
- };
14772
- fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
14789
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke), fillStrokeOrder ? (this._runStroke(rect, context, x, y, rectAttribute, doFillOrStroke, sVisible, originX, originY, strokeCb), this._runFill(rect, context, x, y, rectAttribute, doFillOrStroke, fVisible, originX, originY, fillCb)) : (this._runFill(rect, context, x, y, rectAttribute, doFillOrStroke, fVisible, originX, originY, fillCb), this._runStroke(rect, context, x, y, rectAttribute, doFillOrStroke, sVisible, originX, originY, strokeCb)), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
14790
+ }
14791
+ _runFill(rect, context, x, y, rectAttribute, doFillOrStroke, fVisible, originX, originY, fillCb) {
14792
+ doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
14793
+ }
14794
+ _runStroke(rect, context, x, y, rectAttribute, doFillOrStroke, sVisible, originX, originY, strokeCb) {
14795
+ doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
14773
14796
  }
14774
14797
  draw(rect, renderService, drawContext, params) {
14775
14798
  const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect;
14776
- this.tempTheme = rectAttribute, this._draw(rect, rectAttribute, !1, drawContext, params), this.tempTheme = null;
14799
+ this._draw(rect, rectAttribute, !1, drawContext, params, rectAttribute);
14777
14800
  }
14778
14801
  };
14779
14802
  exports.DefaultCanvasRectRender = __decorate$1x([injectable(), __param$O(0, inject(ContributionProvider)), __param$O(0, named(RectRenderContribution)), __metadata$1a("design:paramtypes", [Object])], exports.DefaultCanvasRectRender);
@@ -14797,10 +14820,10 @@
14797
14820
  constructor(symbolRenderContribitions) {
14798
14821
  super(), this.symbolRenderContribitions = symbolRenderContribitions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(symbolRenderContribitions);
14799
14822
  }
14800
- drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb) {
14823
+ drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb, symbolAttribute) {
14801
14824
  var _a;
14802
- const symbolAttribute = getTheme(symbol, null == params ? void 0 : params.theme).symbol,
14803
- {
14825
+ symbolAttribute = null != symbolAttribute ? symbolAttribute : getTheme(symbol, null == params ? void 0 : params.theme).symbol;
14826
+ const {
14804
14827
  size = symbolAttribute.size,
14805
14828
  x: originX = symbolAttribute.x,
14806
14829
  y: originY = symbolAttribute.y,
@@ -14845,14 +14868,13 @@
14845
14868
  a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && clipRange >= 1 && (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
14846
14869
  };
14847
14870
  fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
14848
- }) && context.closePath(), context.camera = camera, context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
14849
- const _runFill = () => {
14850
- doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
14851
- },
14852
- _runStroke = () => {
14853
- doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && clipRange >= 1 && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
14854
- };
14855
- fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
14871
+ }) && context.closePath(), context.camera = camera, context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb), fillStrokeOrder ? (this._runStroke(symbol, context, x, y, symbolAttribute, doStroke, sVisible, originX, originY, parsedPath, clipRange, scaleX, scaleY, strokeCb), this._runFill(symbol, context, x, y, symbolAttribute, doFill, fVisible, originX, originY, parsedPath, fillCb)) : (this._runFill(symbol, context, x, y, symbolAttribute, doFill, fVisible, originX, originY, parsedPath, fillCb), this._runStroke(symbol, context, x, y, symbolAttribute, doStroke, sVisible, originX, originY, parsedPath, clipRange, scaleX, scaleY, strokeCb)), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
14872
+ }
14873
+ _runFill(symbol, context, x, y, symbolAttribute, doFill, fVisible, originX, originY, parsedPath, fillCb) {
14874
+ doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
14875
+ }
14876
+ _runStroke(symbol, context, x, y, symbolAttribute, doStroke, sVisible, originX, originY, parsedPath, clipRange, scaleX, scaleY, strokeCb) {
14877
+ doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && clipRange >= 1 && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
14856
14878
  }
14857
14879
  draw(symbol, renderService, drawContext, params) {
14858
14880
  const symbolAttribute = getTheme(symbol, null == params ? void 0 : params.theme).symbol;
@@ -15237,16 +15259,19 @@
15237
15259
  constructor(groupRenderContribitions) {
15238
15260
  this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
15239
15261
  }
15240
- drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
15241
- const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
15242
- {
15243
- fill = groupAttribute.fill,
15244
- background: background,
15245
- stroke = groupAttribute.stroke,
15262
+ drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb, groupAttribute) {
15263
+ const {
15264
+ clip: clip,
15265
+ fill: fill,
15266
+ stroke: stroke,
15267
+ background: background
15268
+ } = group.attribute;
15269
+ if (!(clip || fill || stroke || background)) return;
15270
+ groupAttribute = null != groupAttribute ? groupAttribute : getTheme(group, null == params ? void 0 : params.theme).group;
15271
+ const {
15246
15272
  opacity = groupAttribute.opacity,
15247
15273
  width = groupAttribute.width,
15248
15274
  height = groupAttribute.height,
15249
- clip = groupAttribute.clip,
15250
15275
  fillOpacity = groupAttribute.fillOpacity,
15251
15276
  strokeOpacity = groupAttribute.strokeOpacity,
15252
15277
  cornerRadius = groupAttribute.cornerRadius,
@@ -15294,6 +15319,7 @@
15294
15319
  });
15295
15320
  }
15296
15321
  draw(group, renderService, drawContext, params) {
15322
+ var _a;
15297
15323
  const {
15298
15324
  context: context
15299
15325
  } = drawContext;
@@ -15301,16 +15327,18 @@
15301
15327
  const {
15302
15328
  clip: clip,
15303
15329
  baseOpacity = 1,
15304
- drawMode: drawMode,
15305
- x: x,
15306
- y: y,
15307
- width: width,
15308
- height: height
15330
+ drawMode: drawMode
15309
15331
  } = group.attribute,
15310
15332
  lastNativeContext = context.nativeContext,
15311
15333
  lastNativeCanvas = context.canvas.nativeCanvas;
15312
15334
  if (drawMode > 0) {
15313
- const canvas = context.canvas,
15335
+ const {
15336
+ x: x,
15337
+ y: y,
15338
+ width: width,
15339
+ height: height
15340
+ } = group.attribute,
15341
+ canvas = context.canvas,
15314
15342
  newCanvas = vglobal.createCanvas({
15315
15343
  width: canvas.width,
15316
15344
  height: canvas.height,
@@ -15323,21 +15351,27 @@
15323
15351
  clip ? context.save() : context.highPerformanceSave();
15324
15352
  const baseGlobalAlpha = context.baseGlobalAlpha;
15325
15353
  context.baseGlobalAlpha *= baseOpacity;
15326
- const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
15327
- lastModelMatrix = context.modelMatrix;
15354
+ const lastModelMatrix = context.modelMatrix;
15328
15355
  if (context.camera) {
15329
- const nextModelMatrix = mat4Allocate.allocate(),
15356
+ const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
15357
+ nextModelMatrix = mat4Allocate.allocate(),
15330
15358
  modelMatrix = mat4Allocate.allocate();
15331
15359
  getModelMatrix(modelMatrix, group, groupAttribute), multiplyMat4Mat4(nextModelMatrix, lastModelMatrix || nextModelMatrix, modelMatrix), context.modelMatrix = nextModelMatrix, mat4Allocate.free(modelMatrix), context.setTransform(1, 0, 0, 1, 0, 0, !0);
15332
15360
  } else context.transformFromMatrix(group.transMatrix, !0);
15333
- context.beginPath(), params.skipDraw ? this.drawShape(group, context, 0, 0, drawContext, params, () => !1, () => !1) : this.drawShape(group, context, 0, 0, drawContext);
15361
+ context.beginPath(), params.skipDraw ? this.drawShape(group, context, 0, 0, drawContext, params, () => !1, () => !1) : this.drawShape(group, context, 0, 0, drawContext, null, null, null);
15334
15362
  const {
15335
- scrollX = groupAttribute.scrollX,
15336
- scrollY = groupAttribute.scrollY
15363
+ scrollX: scrollX,
15364
+ scrollY: scrollY
15337
15365
  } = group.attribute;
15338
15366
  let p;
15339
- if ((scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha = baseGlobalAlpha, drawMode > 0) {
15340
- const newContext = context.nativeContext,
15367
+ if ((scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.renderInGroup && (p = params.renderInGroup(params.skipDraw, group, drawContext, null === (_a = params.renderInGroupParams) || void 0 === _a ? void 0 : _a.nextM)), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha = baseGlobalAlpha, drawMode > 0) {
15368
+ const {
15369
+ x: x,
15370
+ y: y,
15371
+ width: width,
15372
+ height: height
15373
+ } = group.attribute,
15374
+ newContext = context.nativeContext,
15341
15375
  newCanvas = context.canvas.nativeCanvas;
15342
15376
  lastNativeContext.save(), lastNativeContext.setTransform(context.dpr, 0, 0, context.dpr, 0, 0, !0), 1 === drawMode && newContext.rect(x, y, width, height), lastNativeContext.drawImage(newCanvas, 0, 0, newCanvas.width, newCanvas.height, 0, 0, context.canvas.displayWidth, context.canvas.displayHeight);
15343
15377
  const transform = newContext.getTransform();
@@ -15555,6 +15589,7 @@
15555
15589
  this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
15556
15590
  }
15557
15591
  afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15592
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
15558
15593
  for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
15559
15594
  return !1;
15560
15595
  }
@@ -16098,7 +16133,14 @@
16098
16133
  };
16099
16134
  let DefaultDrawContribution = class {
16100
16135
  constructor(contributions, drawItemInterceptorContributions) {
16101
- this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, isArray$1(this.contributions) || (this.contributions = [this.contributions]), this.init();
16136
+ this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this._renderInGroup = (skipSort, group, drawContext, nextM) => {
16137
+ var _a;
16138
+ skipSort ? group.forEachChildren(item => {
16139
+ drawContext.break || (item.isContainer ? this.renderGroup(item, drawContext, nextM) : this.renderItem(item, drawContext));
16140
+ }) : foreach(group, DefaultAttribute.zIndex, item => {
16141
+ drawContext.break || (item.isContainer ? this.renderGroup(item, drawContext, nextM) : this.renderItem(item, drawContext));
16142
+ }, !1, !!(null === (_a = drawContext.context) || void 0 === _a ? void 0 : _a.camera));
16143
+ }, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, isArray$1(this.contributions) || (this.contributions = [this.contributions]), this.init();
16102
16144
  }
16103
16145
  init() {
16104
16146
  this.contributions.forEach(item => {
@@ -16126,12 +16168,12 @@
16126
16168
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
16127
16169
  }
16128
16170
  const d = context.dpr % 1;
16129
- (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((a, b) => {
16171
+ (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.save(), context.reset(!1), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), 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), renderService.renderTreeRoots.sort((a, b) => {
16130
16172
  var _a, _b;
16131
16173
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
16132
16174
  }).forEach(group => {
16133
16175
  group.isContainer ? this.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
16134
- }), context.restore(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1, context.draw();
16176
+ }), context.restore(), context.draw();
16135
16177
  }
16136
16178
  doRegister() {
16137
16179
  throw new Error("暂不支持");
@@ -16157,15 +16199,12 @@
16157
16199
  const gm = group.transMatrix;
16158
16200
  nextM = matrixAllocate.allocateByObj(parentMatrix).multiply(gm.a, gm.b, gm.c, gm.d, gm.e, gm.f), this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(nextM.getInverse());
16159
16201
  }
16160
- this.renderItem(group, drawContext, {
16161
- drawingCb: () => {
16162
- var _a;
16163
- skipSort ? group.forEachChildren(item => {
16164
- drawContext.break || (item.isContainer ? this.renderGroup(item, drawContext, nextM) : this.renderItem(item, drawContext));
16165
- }) : foreach(group, DefaultAttribute.zIndex, item => {
16166
- drawContext.break || (item.isContainer ? this.renderGroup(item, drawContext, nextM) : this.renderItem(item, drawContext));
16167
- }, !1, !!(null === (_a = drawContext.context) || void 0 === _a ? void 0 : _a.camera));
16168
- }
16202
+ drawContext.isGroupScroll = !(!group.attribute.scrollX && !group.attribute.scrollY), this.renderItem(group, drawContext, {
16203
+ renderInGroupParams: {
16204
+ skipSort: skipSort,
16205
+ nextM: nextM
16206
+ },
16207
+ renderInGroup: this._renderInGroup
16169
16208
  }), this.useDirtyBounds && (this.dirtyBounds.copy(tempBounds), boundsAllocate.free(tempBounds), matrixAllocate.free(nextM));
16170
16209
  }
16171
16210
  _increaseRender(group, drawContext) {
@@ -16222,13 +16261,13 @@
16222
16261
  const renderer = this.getRenderContribution(graphic);
16223
16262
  if (!renderer) return;
16224
16263
  let tempBounds,
16225
- retrans = this.scrollMatrix && (0 !== this.scrollMatrix.e || 0 !== this.scrollMatrix.f);
16226
- if (graphic.parent) {
16264
+ retrans = !1;
16265
+ if (drawContext.isGroupScroll) {
16227
16266
  const {
16228
16267
  scrollX = 0,
16229
16268
  scrollY = 0
16230
16269
  } = graphic.parent.attribute;
16231
- (scrollX || scrollY) && (retrans = !0, this.scrollMatrix || (this.scrollMatrix = matrixAllocate.allocate(1, 0, 0, 1, 0, 0)), this.scrollMatrix.translate(-scrollX, -scrollY));
16270
+ retrans = !0, this.scrollMatrix || (this.scrollMatrix = matrixAllocate.allocate(1, 0, 0, 1, 0, 0)), this.scrollMatrix.translate(-scrollX, -scrollY);
16232
16271
  }
16233
16272
  if (retrans && (tempBounds = this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix)), this.useDirtyBounds && !graphic.isContainer && "empty" !== graphic.attribute.boundsMode && !isRectIntersect(graphic.AABBBounds, null != tempBounds ? tempBounds : this.dirtyBounds, !1)) {
16234
16273
  if (retrans && graphic.parent) {
@@ -16784,7 +16823,7 @@
16784
16823
  }
16785
16824
  constructor() {
16786
16825
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16787
- var _a;
16826
+ var _a, _b;
16788
16827
  super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
16789
16828
  if (!(this._skipRender < 0)) if (visible) {
16790
16829
  if (this.dirtyBounds) {
@@ -16798,8 +16837,7 @@
16798
16837
  }, this.afterRender = stage => {
16799
16838
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
16800
16839
  }, this.afterTickCb = () => {
16801
- var _a;
16802
- this.tickedBeforeRender = !0, "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== this.state && this.render();
16840
+ this.tickedBeforeRender = !0, "rendering" !== this.state && this.render();
16803
16841
  }, this.params = params, this.theme = new Theme(), this.hooks = {
16804
16842
  beforeRender: new SyncHook(["stage"]),
16805
16843
  afterRender: new SyncHook(["stage"])
@@ -16815,13 +16853,14 @@
16815
16853
  }), 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, {
16816
16854
  main: !0
16817
16855
  })), 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.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
16818
- animateMode: "performance"
16856
+ tickRenderMode: "performance"
16819
16857
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
16820
16858
  background: this._background
16821
- }), this.initAnimate(params);
16859
+ }), this.initAnimate(params), this.rafId = null !== (_b = params.rafId) && void 0 !== _b ? _b : Math.floor(6 * Math.random());
16822
16860
  }
16823
16861
  initAnimate(params) {
16824
- this.createTicker && this.createTimeline && (this.ticker = params.ticker || this.createTicker(this), this.timeline = this.createTimeline(), this.ticker.addTimeline(this.timeline), this.ticker.on("tick", this.afterTickCb));
16862
+ var _a;
16863
+ this.createTicker && this.createTimeline && (this.ticker = params.ticker || this.createTicker(this), "effect" !== (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) && this.ticker.setFPS(30), this.timeline = this.createTimeline(), this.ticker.addTimeline(this.timeline), this.ticker.on("tick", this.afterTickCb));
16825
16864
  }
16826
16865
  startAnimate() {
16827
16866
  this.ticker && this.timeline && (this.ticker.start(), this.timeline.resume());
@@ -17069,7 +17108,7 @@
17069
17108
  renderNextFrame(layers, force) {
17070
17109
  this.nextFrameRenderLayerSet.size !== this.childrenCount && (layers || this).forEach(layer => {
17071
17110
  this.nextFrameRenderLayerSet.add(layer);
17072
- }), this.willNextFrameRender || (this.willNextFrameRender = !0, this.global.getRequestAnimationFrame()(() => {
17111
+ }), this.willNextFrameRender || (this.willNextFrameRender = !0, this.global.getSpecifiedRequestAnimationFrame(this.rafId)(() => {
17073
17112
  this._doRenderInThisFrame(), this.willNextFrameRender = !1;
17074
17113
  }));
17075
17114
  }
@@ -17276,6 +17315,9 @@
17276
17315
  clear() {
17277
17316
  this.save(), this.resetTransform(), this.restore();
17278
17317
  }
17318
+ reset() {
17319
+ this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0;
17320
+ }
17279
17321
  restore() {
17280
17322
  this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop(), this.setTransformForCurrent());
17281
17323
  }
@@ -18614,21 +18656,6 @@
18614
18656
  return res;
18615
18657
  };
18616
18658
 
18617
- class PerformanceRAF {
18618
- constructor() {
18619
- this.nextAnimationFrameCbs = [], this.runAnimationFrame = time => {
18620
- const cbs = this.nextAnimationFrameCbs;
18621
- this.nextAnimationFrameCbs = [];
18622
- for (let i = 0; i < cbs.length; i++) cbs[i](time);
18623
- }, this.tryRunAnimationFrameNextFrame = () => {
18624
- this.nextAnimationFrameCbs && 1 === this.nextAnimationFrameCbs.length && vglobal.getRequestAnimationFrame()(this.runAnimationFrame);
18625
- };
18626
- }
18627
- addAnimationFrameCb(callback) {
18628
- return this.nextAnimationFrameCbs.push(callback), this.tryRunAnimationFrameNextFrame(), this.nextAnimationFrameCbs.length - 1;
18629
- }
18630
- }
18631
-
18632
18659
  var __rest$1 = undefined && undefined.__rest || function (s, e) {
18633
18660
  var t = {};
18634
18661
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
@@ -23459,10 +23486,11 @@
23459
23486
  return this.nativeContext.fillStyle;
23460
23487
  }
23461
23488
  set font(d) {
23462
- this.nativeContext.font = d;
23489
+ d !== this._font && (this._font = d, this.nativeContext.font = d);
23463
23490
  }
23464
23491
  get font() {
23465
- return this.nativeContext.font;
23492
+ var _a;
23493
+ return null !== (_a = this._font) && void 0 !== _a ? _a : this.nativeContext.font;
23466
23494
  }
23467
23495
  set globalAlpha(d) {
23468
23496
  this.nativeContext.globalAlpha = d * this.baseGlobalAlpha;
@@ -23561,7 +23589,8 @@
23561
23589
  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), this.baseGlobalAlpha = 1;
23562
23590
  }
23563
23591
  reset() {
23564
- this.stack.length && Logger.getInstance().warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
23592
+ let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
23593
+ this.stack.length && Logger.getInstance().warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, setTransform && this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
23565
23594
  }
23566
23595
  getCanvas() {
23567
23596
  return this.canvas;
@@ -23583,7 +23612,7 @@
23583
23612
  this.save(), this.resetTransform(), this.nativeContext.clearRect(0, 0, this.canvas.width, this.canvas.height), this.restore();
23584
23613
  }
23585
23614
  restore() {
23586
- this.nativeContext.restore(), this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop(), this.setTransformForCurrent(!0));
23615
+ this.nativeContext.restore(), this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop(), this.setTransformForCurrent(!0)), this.font = "", this._clearFilterStyle = !1, this._clearShadowStyle = !1;
23587
23616
  }
23588
23617
  highPerformanceRestore() {
23589
23618
  this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
@@ -23856,14 +23885,20 @@
23856
23885
  const {
23857
23886
  opacity = defaultParams.opacity,
23858
23887
  shadowBlur = defaultParams.shadowBlur,
23859
- shadowColor = defaultParams.shadowColor,
23860
- shadowOffsetX = defaultParams.shadowOffsetX,
23861
- shadowOffsetY = defaultParams.shadowOffsetY,
23862
23888
  blur = defaultParams.blur,
23863
- filter = defaultParams.filter,
23864
23889
  globalCompositeOperation = defaultParams.globalCompositeOperation
23865
23890
  } = attribute;
23866
- opacity <= 1e-12 || (shadowBlur || shadowOffsetX || shadowOffsetY ? (_context.shadowBlur = shadowBlur * this.dpr, _context.shadowColor = shadowColor, _context.shadowOffsetX = shadowOffsetX * this.dpr, _context.shadowOffsetY = shadowOffsetY * this.dpr, this._clearShadowStyle = !0) : this._clearShadowStyle && (_context.shadowBlur = 0, _context.shadowOffsetX = 0, _context.shadowOffsetY = 0), blur ? (_context.filter = `blur(${blur}px)`, this._clearFilterStyle = !0) : filter ? (_context.filter = filter, this._clearFilterStyle = !0) : this._clearFilterStyle && (_context.filter = "blur(0px)", this._clearFilterStyle = !1), globalCompositeOperation ? (_context.globalCompositeOperation = globalCompositeOperation, this._clearGlobalCompositeOperationStyle = !0) : this._clearGlobalCompositeOperationStyle && (_context.globalCompositeOperation = "source-over", this._clearGlobalCompositeOperationStyle = !1));
23891
+ if (!(opacity <= 1e-12)) {
23892
+ if (shadowBlur) {
23893
+ const {
23894
+ shadowColor = defaultParams.shadowColor,
23895
+ shadowOffsetX = defaultParams.shadowOffsetX,
23896
+ shadowOffsetY = defaultParams.shadowOffsetY
23897
+ } = attribute;
23898
+ _context.shadowBlur = shadowBlur * this.dpr, _context.shadowColor = shadowColor, _context.shadowOffsetX = shadowOffsetX * this.dpr, _context.shadowOffsetY = shadowOffsetY * this.dpr, this._clearShadowStyle = !0;
23899
+ } else this._clearShadowStyle && (_context.shadowBlur = 0, _context.shadowOffsetX = 0, _context.shadowOffsetY = 0);
23900
+ blur ? (_context.filter = `blur(${blur}px)`, this._clearFilterStyle = !0) : this._clearFilterStyle && (_context.filter = "blur(0px)", this._clearFilterStyle = !1), globalCompositeOperation ? (_context.globalCompositeOperation = globalCompositeOperation, this._clearGlobalCompositeOperationStyle = !0) : this._clearGlobalCompositeOperationStyle && (_context.globalCompositeOperation = "source-over", this._clearGlobalCompositeOperationStyle = !1);
23901
+ }
23867
23902
  }
23868
23903
  setStrokeStyle(params, attribute, offsetX, offsetY, defaultParams) {
23869
23904
  if (Array.isArray(defaultParams)) {
@@ -23902,7 +23937,7 @@
23902
23937
  const {
23903
23938
  scaleIn3d = defaultParams.scaleIn3d
23904
23939
  } = params;
23905
- params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, scaleIn3d && this.camera && this.camera.getProjectionScale(z));
23940
+ params.font ? this.font = params.font : this.font = getContextFont(params, defaultParams, scaleIn3d && this.camera && this.camera.getProjectionScale(z));
23906
23941
  const {
23907
23942
  fontFamily = defaultParams.fontFamily,
23908
23943
  fontSize = defaultParams.fontSize
@@ -23912,7 +23947,7 @@
23912
23947
  setTextStyle(params, defaultParams, z) {
23913
23948
  var _a, _b;
23914
23949
  const _context = this.nativeContext;
23915
- defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, this.camera && this.camera.getProjectionScale(z));
23950
+ defaultParams || (defaultParams = this.textAttributes), params.font ? this.font = params.font : this.font = getContextFont(params, defaultParams, this.camera && this.camera.getProjectionScale(z));
23916
23951
  const {
23917
23952
  fontFamily = defaultParams.fontFamily,
23918
23953
  fontSize = defaultParams.fontSize
@@ -29816,7 +29851,7 @@
29816
29851
 
29817
29852
  const roughModule = _roughModule;
29818
29853
 
29819
- const version = "0.23.0-alpha.2";
29854
+ const version = "0.23.0-alpha.3";
29820
29855
  preLoadAllModule();
29821
29856
  if (isBrowserEnv()) {
29822
29857
  loadBrowserEnv(container);