@visactor/vrender-core 0.16.0-alpha.4 → 0.16.0

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.
Files changed (139) hide show
  1. package/cjs/core/stage.js +8 -3
  2. package/cjs/core/stage.js.map +1 -1
  3. package/cjs/graphic/config.js +3 -1
  4. package/cjs/graphic/config.js.map +1 -1
  5. package/cjs/graphic/graphic-service/common-contribution.js +1 -1
  6. package/cjs/graphic/graphic-service/common-contribution.js.map +1 -1
  7. package/cjs/graphic/graphic-service/symbol-contribution.js +1 -1
  8. package/cjs/graphic/graphic-service/symbol-contribution.js.map +1 -1
  9. package/cjs/graphic/graphic.d.ts +3 -0
  10. package/cjs/graphic/graphic.js +45 -19
  11. package/cjs/graphic/graphic.js.map +1 -1
  12. package/cjs/interface/context.d.ts +2 -1
  13. package/cjs/interface/context.js.map +1 -1
  14. package/cjs/interface/event.d.ts +1 -0
  15. package/cjs/interface/event.js.map +1 -1
  16. package/cjs/interface/graphic.d.ts +4 -2
  17. package/cjs/interface/graphic.js.map +1 -1
  18. package/cjs/interface/stage.d.ts +1 -0
  19. package/cjs/interface/stage.js.map +1 -1
  20. package/cjs/picker/pick-interceptor.d.ts +6 -0
  21. package/cjs/picker/pick-interceptor.js +22 -1
  22. package/cjs/picker/pick-interceptor.js.map +1 -1
  23. package/cjs/picker/pick-modules.js +2 -0
  24. package/cjs/picker/pick-modules.js.map +1 -1
  25. package/cjs/render/contributions/render/arc-render.js +2 -2
  26. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  27. package/cjs/render/contributions/render/arc3d-render.js +2 -2
  28. package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
  29. package/cjs/render/contributions/render/area-render.js +1 -1
  30. package/cjs/render/contributions/render/area-render.js.map +1 -1
  31. package/cjs/render/contributions/render/base-render.js.map +1 -1
  32. package/cjs/render/contributions/render/circle-render.js +1 -1
  33. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  34. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  35. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  36. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  37. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  38. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  39. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  40. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  41. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  42. package/cjs/render/contributions/render/draw-contribution.js +11 -2
  43. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  44. package/cjs/render/contributions/render/draw-interceptor.d.ts +5 -1
  45. package/cjs/render/contributions/render/draw-interceptor.js +35 -16
  46. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  47. package/cjs/render/contributions/render/group-render.js +1 -1
  48. package/cjs/render/contributions/render/group-render.js.map +1 -1
  49. package/cjs/render/contributions/render/image-render.js +3 -2
  50. package/cjs/render/contributions/render/image-render.js.map +1 -1
  51. package/cjs/render/contributions/render/incremental-area-render.js +1 -1
  52. package/cjs/render/contributions/render/incremental-area-render.js.map +1 -1
  53. package/cjs/render/contributions/render/incremental-line-render.js +1 -1
  54. package/cjs/render/contributions/render/incremental-line-render.js.map +1 -1
  55. package/cjs/render/contributions/render/line-render.js +1 -1
  56. package/cjs/render/contributions/render/line-render.js.map +1 -1
  57. package/cjs/render/contributions/render/path-render.js +1 -1
  58. package/cjs/render/contributions/render/path-render.js.map +1 -1
  59. package/cjs/render/contributions/render/polygon-render.js +2 -2
  60. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  61. package/cjs/render/contributions/render/rect-render.js +1 -1
  62. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  63. package/cjs/render/contributions/render/symbol-render.js +1 -1
  64. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  65. package/cjs/render/contributions/render/text-render.js +2 -2
  66. package/cjs/render/contributions/render/text-render.js.map +1 -1
  67. package/cjs/render/contributions/render/utils.js +1 -1
  68. package/cjs/render/contributions/render/utils.js.map +1 -1
  69. package/dist/index.js +188 -67
  70. package/dist/index.min.js +1 -1
  71. package/es/core/stage.js +8 -3
  72. package/es/core/stage.js.map +1 -1
  73. package/es/graphic/config.js +3 -1
  74. package/es/graphic/config.js.map +1 -1
  75. package/es/graphic/graphic-service/common-contribution.js +1 -1
  76. package/es/graphic/graphic-service/common-contribution.js.map +1 -1
  77. package/es/graphic/graphic-service/symbol-contribution.js +1 -1
  78. package/es/graphic/graphic-service/symbol-contribution.js.map +1 -1
  79. package/es/graphic/graphic.d.ts +3 -0
  80. package/es/graphic/graphic.js +44 -19
  81. package/es/graphic/graphic.js.map +1 -1
  82. package/es/interface/context.d.ts +2 -1
  83. package/es/interface/context.js.map +1 -1
  84. package/es/interface/event.d.ts +1 -0
  85. package/es/interface/event.js.map +1 -1
  86. package/es/interface/graphic.d.ts +4 -2
  87. package/es/interface/graphic.js.map +1 -1
  88. package/es/interface/stage.d.ts +1 -0
  89. package/es/interface/stage.js.map +1 -1
  90. package/es/picker/pick-interceptor.d.ts +6 -0
  91. package/es/picker/pick-interceptor.js +22 -0
  92. package/es/picker/pick-interceptor.js.map +1 -1
  93. package/es/picker/pick-modules.js +2 -1
  94. package/es/picker/pick-modules.js.map +1 -1
  95. package/es/render/contributions/render/arc-render.js +2 -2
  96. package/es/render/contributions/render/arc-render.js.map +1 -1
  97. package/es/render/contributions/render/arc3d-render.js +2 -2
  98. package/es/render/contributions/render/arc3d-render.js.map +1 -1
  99. package/es/render/contributions/render/area-render.js +1 -1
  100. package/es/render/contributions/render/area-render.js.map +1 -1
  101. package/es/render/contributions/render/base-render.js.map +1 -1
  102. package/es/render/contributions/render/circle-render.js +1 -1
  103. package/es/render/contributions/render/circle-render.js.map +1 -1
  104. package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  105. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  106. package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  107. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  108. package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  109. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  110. package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  111. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  112. package/es/render/contributions/render/draw-contribution.js +11 -2
  113. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  114. package/es/render/contributions/render/draw-interceptor.d.ts +5 -1
  115. package/es/render/contributions/render/draw-interceptor.js +36 -17
  116. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  117. package/es/render/contributions/render/group-render.js +1 -1
  118. package/es/render/contributions/render/group-render.js.map +1 -1
  119. package/es/render/contributions/render/image-render.js +3 -2
  120. package/es/render/contributions/render/image-render.js.map +1 -1
  121. package/es/render/contributions/render/incremental-area-render.js +1 -1
  122. package/es/render/contributions/render/incremental-area-render.js.map +1 -1
  123. package/es/render/contributions/render/incremental-line-render.js +1 -1
  124. package/es/render/contributions/render/incremental-line-render.js.map +1 -1
  125. package/es/render/contributions/render/line-render.js +1 -1
  126. package/es/render/contributions/render/line-render.js.map +1 -1
  127. package/es/render/contributions/render/path-render.js +1 -1
  128. package/es/render/contributions/render/path-render.js.map +1 -1
  129. package/es/render/contributions/render/polygon-render.js +2 -2
  130. package/es/render/contributions/render/polygon-render.js.map +1 -1
  131. package/es/render/contributions/render/rect-render.js +1 -1
  132. package/es/render/contributions/render/rect-render.js.map +1 -1
  133. package/es/render/contributions/render/symbol-render.js +1 -1
  134. package/es/render/contributions/render/symbol-render.js.map +1 -1
  135. package/es/render/contributions/render/text-render.js +2 -2
  136. package/es/render/contributions/render/text-render.js.map +1 -1
  137. package/es/render/contributions/render/utils.js +1 -1
  138. package/es/render/contributions/render/utils.js.map +1 -1
  139. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -4276,7 +4276,7 @@
4276
4276
  const DefaultDebugAttribute = {
4277
4277
  _debug_bounds: false
4278
4278
  };
4279
- const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, pickable: true, childrenPickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, interactive: false }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
4279
+ const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, pickable: true, childrenPickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, globalZIndex: 1, globalCompositeOperation: '', overflow: 'hidden' }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
4280
4280
  function addAttributeToPrototype(obj, c, keys) {
4281
4281
  keys.forEach(key => {
4282
4282
  c.prototype[key] = obj[key];
@@ -11300,6 +11300,7 @@
11300
11300
  ResourceLoader.cache = new Map();
11301
11301
 
11302
11302
  const tempMatrix = new vutils.Matrix();
11303
+ const tempBounds$1 = new vutils.AABBBounds();
11303
11304
  const PURE_STYLE_KEY = [
11304
11305
  'stroke',
11305
11306
  'opacity',
@@ -11818,15 +11819,39 @@
11818
11819
  var _a, _b, _c, _d;
11819
11820
  if (hasAnimation) {
11820
11821
  const keys = Object.keys(attrs);
11821
- const animateAttrs = isClear
11822
- ? keys.reduce((res, key) => {
11823
- res[key] = attrs[key] === undefined ? this.getDefaultAttribute(key) : attrs[key];
11824
- return res;
11825
- }, {})
11826
- : attrs;
11822
+ const noWorkAAttr = this.getNoWorkAnimateAttr();
11823
+ const animateAttrs = {};
11824
+ let noAnimateAttrs;
11825
+ if (isClear) {
11826
+ keys.forEach(key => {
11827
+ if (!noWorkAAttr[key]) {
11828
+ animateAttrs[key] = attrs[key] === undefined ? this.getDefaultAttribute(key) : attrs[key];
11829
+ }
11830
+ else {
11831
+ if (!noAnimateAttrs) {
11832
+ noAnimateAttrs = {};
11833
+ }
11834
+ noAnimateAttrs[key] = attrs[key];
11835
+ }
11836
+ });
11837
+ }
11838
+ else {
11839
+ keys.forEach(key => {
11840
+ if (!noWorkAAttr[key]) {
11841
+ animateAttrs[key] = attrs[key];
11842
+ }
11843
+ else {
11844
+ if (!noAnimateAttrs) {
11845
+ noAnimateAttrs = {};
11846
+ }
11847
+ noAnimateAttrs[key] = attrs[key];
11848
+ }
11849
+ });
11850
+ }
11827
11851
  const animate = this.animate();
11828
11852
  animate.stateNames = stateNames;
11829
11853
  animate.to(animateAttrs, (_b = (_a = this.stateAnimateConfig) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : DefaultStateAnimateConfig.duration, (_d = (_c = this.stateAnimateConfig) === null || _c === void 0 ? void 0 : _c.easing) !== null && _d !== void 0 ? _d : DefaultStateAnimateConfig.easing);
11854
+ noAnimateAttrs && this.setAttributes(noAnimateAttrs, false, { type: exports.AttributeUpdateType.STATE });
11830
11855
  }
11831
11856
  else {
11832
11857
  this.setAttributes(attrs, false, { type: exports.AttributeUpdateType.STATE });
@@ -11979,26 +12004,44 @@
11979
12004
  needUpdateLayout() {
11980
12005
  return !!(this._updateTag & exports.UpdateTag.UPDATE_LAYOUT);
11981
12006
  }
12007
+ getAnchor(anchor, params) {
12008
+ const _anchor = [0, 0];
12009
+ const getBounds = () => {
12010
+ if (params.b) {
12011
+ return params.b;
12012
+ }
12013
+ const { scaleX, scaleY, angle } = this.attribute;
12014
+ tempBounds$1.copy(this._AABBBounds);
12015
+ this.setAttributes({ scaleX: 1, scaleY: 1, angle: 0 });
12016
+ params.b = this.AABBBounds.clone();
12017
+ this._AABBBounds.copy(tempBounds$1);
12018
+ this.setAttributes({ scaleX, scaleY, angle });
12019
+ return params.b;
12020
+ };
12021
+ if (typeof anchor[0] === 'string') {
12022
+ const ratio = parseFloat(anchor[0]) / 100;
12023
+ const bounds = getBounds();
12024
+ _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
12025
+ }
12026
+ else {
12027
+ _anchor[0] = anchor[0];
12028
+ }
12029
+ if (typeof anchor[1] === 'string') {
12030
+ const ratio = parseFloat(anchor[1]) / 100;
12031
+ const bounds = getBounds();
12032
+ _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;
12033
+ }
12034
+ else {
12035
+ _anchor[1] = anchor[1];
12036
+ }
12037
+ return _anchor;
12038
+ }
11982
12039
  doUpdateLocalMatrix() {
11983
12040
  const { x = DefaultTransform.x, y = DefaultTransform.y, scaleX = DefaultTransform.scaleX, scaleY = DefaultTransform.scaleY, angle = DefaultTransform.angle, scaleCenter, anchor, postMatrix } = this.attribute;
11984
- const _anchor = [0, 0];
12041
+ let _anchor = [0, 0];
12042
+ const params = {};
11985
12043
  if (anchor) {
11986
- if (typeof anchor[0] === 'string') {
11987
- const ratio = parseFloat(anchor[0]) / 100;
11988
- const bounds = this.AABBBounds;
11989
- _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
11990
- }
11991
- else {
11992
- _anchor[0] = anchor[0];
11993
- }
11994
- if (typeof anchor[1] === 'string') {
11995
- const ratio = parseFloat(anchor[1]) / 100;
11996
- const bounds = this.AABBBounds;
11997
- _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
11998
- }
11999
- else {
12000
- _anchor[1] = anchor[1];
12001
- }
12044
+ _anchor = this.getAnchor(anchor, params);
12002
12045
  }
12003
12046
  if (scaleCenter && (scaleX !== 1 || scaleY !== 1)) {
12004
12047
  const m = this._transMatrix;
@@ -12007,7 +12050,8 @@
12007
12050
  m.rotate(angle);
12008
12051
  m.translate(-_anchor[0], -_anchor[1]);
12009
12052
  m.translate(x, y);
12010
- application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: scaleCenter[0], y: scaleCenter[1] });
12053
+ _anchor = this.getAnchor(scaleCenter, params);
12054
+ application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: _anchor[0], y: _anchor[1] });
12011
12055
  }
12012
12056
  else {
12013
12057
  vutils.normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);
@@ -13515,7 +13559,7 @@
13515
13559
  context.beginPath();
13516
13560
  const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
13517
13561
  renderCommandList(path.commandList, context, x, y);
13518
- context.setShadowStyle && context.setShadowStyle(graphic, graphic.attribute, themeAttributes);
13562
+ context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);
13519
13563
  if (doStroke) {
13520
13564
  if (strokeCb) {
13521
13565
  strokeCb(context, graphic.attribute, themeAttributes);
@@ -17702,7 +17746,7 @@
17702
17746
  if (outerBorder) {
17703
17747
  const defaultOuterBorder = theme.outerBorder;
17704
17748
  const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;
17705
- aabbBounds.expand(distance + shadowBlur + lineWidth / 2);
17749
+ aabbBounds.expand(distance + (shadowBlur + lineWidth) / 2);
17706
17750
  }
17707
17751
  return aabbBounds;
17708
17752
  }
@@ -17725,7 +17769,7 @@
17725
17769
  if (outerBorder) {
17726
17770
  const defaultOuterBorder = symbolTheme.outerBorder;
17727
17771
  const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;
17728
- boundStroke(aabbBounds, distance + shadowBlur + lineWidth / 2, true, strokeBoundsBuffer);
17772
+ boundStroke(aabbBounds, distance + (shadowBlur + lineWidth) / 2, true, strokeBoundsBuffer);
17729
17773
  }
17730
17774
  return aabbBounds;
17731
17775
  }
@@ -19249,8 +19293,8 @@
19249
19293
  context.beginPath();
19250
19294
  drawArcPath$1(arc, context, x, y, outerRadius, innerRadius);
19251
19295
  beforeRenderContribitionsRuned = true;
19296
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
19252
19297
  this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
19253
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
19254
19298
  if (doFill) {
19255
19299
  if (fillCb) {
19256
19300
  fillCb(context, arc.attribute, arcAttribute);
@@ -19354,8 +19398,8 @@
19354
19398
  context.beginPath();
19355
19399
  context.arc(x, y, radius, startAngle, endAngle);
19356
19400
  context.closePath();
19401
+ context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
19357
19402
  this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
19358
- context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute);
19359
19403
  if (doFill) {
19360
19404
  if (fillCb) {
19361
19405
  fillCb(context, circle.attribute, circleAttribute);
@@ -19629,7 +19673,7 @@
19629
19673
  line.attribute.curveType.includes('Closed')) {
19630
19674
  context.closePath();
19631
19675
  }
19632
- context.setShadowStyle && context.setShadowStyle(line, attribute, defaultAttribute);
19676
+ context.setShadowBlendStyle && context.setShadowBlendStyle(line, attribute, defaultAttribute);
19633
19677
  const { x: originX = 0, x: originY = 0 } = attribute;
19634
19678
  const ret = false;
19635
19679
  if (fill !== false) {
@@ -20361,7 +20405,7 @@
20361
20405
  zeroY: connectedY
20362
20406
  });
20363
20407
  this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
20364
- context.setShadowStyle && context.setShadowStyle(area, attribute, defaultAttribute);
20408
+ context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
20365
20409
  const { x: originX = 0, x: originY = 0 } = attribute;
20366
20410
  if (fill !== false) {
20367
20411
  if (fillCb) {
@@ -20430,8 +20474,8 @@
20430
20474
  const path2D = (_b = path.attribute.path) !== null && _b !== void 0 ? _b : pathAttribute.path;
20431
20475
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
20432
20476
  }
20477
+ context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute);
20433
20478
  this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
20434
- context.setShadowStyle && context.setShadowStyle(path, path.attribute, pathAttribute);
20435
20479
  if (doStroke) {
20436
20480
  if (strokeCb) {
20437
20481
  strokeCb(context, path.attribute, pathAttribute);
@@ -20587,8 +20631,8 @@
20587
20631
  doFill,
20588
20632
  doStroke
20589
20633
  };
20634
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
20590
20635
  this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
20591
- context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute);
20592
20636
  if (doFillOrStroke.doFill) {
20593
20637
  if (fillCb) {
20594
20638
  fillCb(context, rect.attribute, rectAttribute);
@@ -20696,8 +20740,8 @@
20696
20740
  context.closePath();
20697
20741
  }
20698
20742
  }
20743
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
20699
20744
  this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
20700
- context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute);
20701
20745
  if (doFill && !parsedPath.isSvg) {
20702
20746
  if (fillCb) {
20703
20747
  fillCb(context, symbol.attribute, symbolAttribute);
@@ -20756,8 +20800,8 @@
20756
20800
  const transform3dMatrixToContextMatrix = !keepDirIn3d;
20757
20801
  const z = this.z || 0;
20758
20802
  context.beginPath();
20803
+ context.setShadowBlendStyle && context.setShadowBlendStyle(text, text.attribute, textAttribute);
20759
20804
  this.beforeRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
20760
- context.setShadowStyle && context.setShadowStyle(text, text.attribute, textAttribute);
20761
20805
  transform3dMatrixToContextMatrix && this.transformUseContext2d(text, textAttribute, z, context);
20762
20806
  const drawText = (t, offsetX, offsetY, direction) => {
20763
20807
  let _x = x + offsetX;
@@ -21099,8 +21143,8 @@
21099
21143
  drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath);
21100
21144
  }
21101
21145
  closePath && context.closePath();
21146
+ context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute);
21102
21147
  this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
21103
- context.setShadowStyle && context.setShadowStyle(polygon, polygon.attribute, polygonAttribute);
21104
21148
  if (doFill) {
21105
21149
  if (fillCb) {
21106
21150
  fillCb(context, polygon.attribute, polygonAttribute);
@@ -21149,8 +21193,8 @@
21149
21193
  return;
21150
21194
  }
21151
21195
  const { fVisible, sVisible, doFill, doStroke } = data;
21196
+ context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute);
21152
21197
  this.beforeRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
21153
- context.setShadowStyle && context.setShadowStyle(image, imageAttribute);
21154
21198
  if (doFill) {
21155
21199
  if (fillCb) {
21156
21200
  fillCb(context, image.attribute, imageAttribute);
@@ -21650,7 +21694,7 @@
21650
21694
  });
21651
21695
  context.beginPath();
21652
21696
  drawArcPath$1(arc, context, x, y, outerRadius + d, innerRadius - d);
21653
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
21697
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
21654
21698
  if (strokeCb) {
21655
21699
  strokeCb(context, outerBorder, arcAttribute.outerBorder);
21656
21700
  }
@@ -21674,7 +21718,7 @@
21674
21718
  });
21675
21719
  context.beginPath();
21676
21720
  drawArcPath$1(arc, context, x, y, outerRadius - d, innerRadius + d);
21677
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
21721
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
21678
21722
  if (strokeCb) {
21679
21723
  strokeCb(context, innerBorder, arcAttribute.innerBorder);
21680
21724
  }
@@ -21734,7 +21778,7 @@
21734
21778
  context.beginPath();
21735
21779
  context.arc(x, y, radius + dw, startAngle, endAngle);
21736
21780
  context.closePath();
21737
- context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute);
21781
+ context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
21738
21782
  if (strokeCb) {
21739
21783
  strokeCb(context, outerBorder, circleAttribute.outerBorder);
21740
21784
  }
@@ -21753,7 +21797,7 @@
21753
21797
  context.beginPath();
21754
21798
  context.arc(x, y, radius - dw, startAngle, endAngle);
21755
21799
  context.closePath();
21756
- context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute);
21800
+ context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
21757
21801
  if (strokeCb) {
21758
21802
  strokeCb(context, innerBorder, circleAttribute.innerBorder);
21759
21803
  }
@@ -21948,7 +21992,7 @@
21948
21992
  context.beginPath();
21949
21993
  createRectPath(context, nextX, nextY, width + dw, height + dw, cornerRadius);
21950
21994
  }
21951
- context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute);
21995
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
21952
21996
  if (strokeCb) {
21953
21997
  strokeCb(context, outerBorder, rectAttribute.outerBorder);
21954
21998
  }
@@ -21974,7 +22018,7 @@
21974
22018
  context.beginPath();
21975
22019
  createRectPath(context, nextX, nextY, width - dw, height - dw, cornerRadius);
21976
22020
  }
21977
- context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute);
22021
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
21978
22022
  if (strokeCb) {
21979
22023
  strokeCb(context, innerBorder, rectAttribute.innerBorder);
21980
22024
  }
@@ -22098,7 +22142,7 @@
22098
22142
  if (parsedPath.drawOffset(context, size, x, y, d) === false) {
22099
22143
  context.closePath();
22100
22144
  }
22101
- context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute);
22145
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
22102
22146
  if (strokeCb) {
22103
22147
  strokeCb(context, outerBorder, symbolAttribute.outerBorder);
22104
22148
  }
@@ -22117,7 +22161,7 @@
22117
22161
  if (parsedPath.drawOffset(context, size, x, y, -d) === false) {
22118
22162
  context.closePath();
22119
22163
  }
22120
- context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute);
22164
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
22121
22165
  if (strokeCb) {
22122
22166
  strokeCb(context, innerBorder, symbolAttribute.innerBorder);
22123
22167
  }
@@ -22358,6 +22402,30 @@
22358
22402
  exports.ShadowRootPickItemInterceptorContribution = __decorate([
22359
22403
  injectable()
22360
22404
  ], exports.ShadowRootPickItemInterceptorContribution);
22405
+ exports.InteractivePickItemInterceptorContribution = class InteractivePickItemInterceptorContribution {
22406
+ constructor() {
22407
+ this.order = 1;
22408
+ }
22409
+ beforePickItem(graphic, pickerService, point, pickParams, params) {
22410
+ const originGraphic = graphic.baseGraphic;
22411
+ if (originGraphic && originGraphic.parent) {
22412
+ const newPoint = new vutils.Point(point.x, point.y);
22413
+ const context = pickerService.pickContext;
22414
+ context.highPerformanceSave();
22415
+ const parentMatrix = originGraphic.parent.globalTransMatrix;
22416
+ parentMatrix.transformPoint(newPoint, newPoint);
22417
+ const result = originGraphic.isContainer
22418
+ ? pickerService.pickGroup(originGraphic, newPoint.clone(), parentMatrix, pickParams)
22419
+ : pickerService.pickItem(originGraphic, newPoint.clone(), parentMatrix, pickParams);
22420
+ context.highPerformanceRestore();
22421
+ return result;
22422
+ }
22423
+ return null;
22424
+ }
22425
+ };
22426
+ exports.InteractivePickItemInterceptorContribution = __decorate([
22427
+ injectable()
22428
+ ], exports.InteractivePickItemInterceptorContribution);
22361
22429
  exports.Canvas3DPickItemInterceptor = class Canvas3DPickItemInterceptor {
22362
22430
  constructor() {
22363
22431
  this.order = 1;
@@ -22492,6 +22560,8 @@
22492
22560
  bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor);
22493
22561
  bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope();
22494
22562
  bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution);
22563
+ bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope();
22564
+ bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution);
22495
22565
  bindContributionProvider(bind, PickItemInterceptor);
22496
22566
  });
22497
22567
 
@@ -23022,6 +23092,7 @@
23022
23092
  }
23023
23093
  const { context } = drawContext;
23024
23094
  context.highPerformanceSave();
23095
+ context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true);
23025
23096
  const b = graphic.AABBBounds;
23026
23097
  if (graphic.attribute._debug_bounds !== true) {
23027
23098
  graphic.attribute._debug_bounds(context, graphic);
@@ -23039,27 +23110,31 @@
23039
23110
  this.order = 1;
23040
23111
  }
23041
23112
  beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
23042
- let interactiveGraphic;
23043
- if (graphic.attribute.interactive) {
23044
- interactiveGraphic = graphic.interactiveGraphic;
23113
+ if (this.processing) {
23114
+ return false;
23115
+ }
23116
+ if (graphic.baseGraphic) {
23117
+ return this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params);
23118
+ }
23119
+ return this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params);
23120
+ }
23121
+ beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
23122
+ let interactiveGraphic = graphic.interactiveGraphic;
23123
+ if (graphic.attribute.globalZIndex) {
23045
23124
  if (!interactiveGraphic) {
23046
23125
  interactiveGraphic = graphic.clone();
23047
23126
  graphic.interactiveGraphic = interactiveGraphic;
23127
+ interactiveGraphic.baseGraphic = graphic;
23048
23128
  }
23049
- const m = graphic.globalTransMatrix;
23050
23129
  interactiveGraphic.setAttributes({
23051
- x: 0,
23052
- y: 0,
23053
- scaleX: 1,
23054
- scaleY: 1,
23055
- angle: 0,
23056
- postMatrix: m,
23057
- interactive: false
23130
+ globalZIndex: 0,
23131
+ zIndex: graphic.attribute.globalZIndex
23058
23132
  }, false, { skipUpdateCallback: true });
23059
23133
  drawContext.stage.tryInitInteractiveLayer();
23060
23134
  const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');
23061
23135
  if (interactiveLayer) {
23062
- interactiveLayer.add(interactiveGraphic);
23136
+ const shadowRoot = this.getShadowRoot(interactiveLayer);
23137
+ shadowRoot.add(interactiveGraphic);
23063
23138
  }
23064
23139
  return true;
23065
23140
  }
@@ -23067,11 +23142,40 @@
23067
23142
  drawContext.stage.tryInitInteractiveLayer();
23068
23143
  const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');
23069
23144
  if (interactiveLayer) {
23070
- interactiveLayer.removeChild(interactiveGraphic);
23145
+ const shadowRoot = this.getShadowRoot(interactiveLayer);
23146
+ shadowRoot.removeChild(interactiveGraphic);
23071
23147
  }
23148
+ graphic.interactiveGraphic = null;
23149
+ interactiveGraphic.baseGraphic = null;
23150
+ }
23151
+ return false;
23152
+ }
23153
+ beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
23154
+ const baseGraphic = graphic.baseGraphic;
23155
+ if (baseGraphic) {
23156
+ this.processing = true;
23157
+ const { context } = drawContext;
23158
+ context.highPerformanceSave();
23159
+ context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, true);
23160
+ baseGraphic.isContainer
23161
+ ? drawContribution.renderGroup(baseGraphic, drawContext)
23162
+ : drawContribution.renderItem(baseGraphic, drawContext);
23163
+ context.highPerformanceRestore();
23164
+ this.processing = false;
23165
+ return true;
23072
23166
  }
23073
23167
  return false;
23074
23168
  }
23169
+ getShadowRoot(interactiveLayer) {
23170
+ var _a;
23171
+ let group = interactiveLayer.getElementById('_interactive_group');
23172
+ if (!group) {
23173
+ group = createGroup({});
23174
+ group.id = '_interactive_group';
23175
+ interactiveLayer.add(group);
23176
+ }
23177
+ return (_a = group.shadowRoot) !== null && _a !== void 0 ? _a : group.attachShadow();
23178
+ }
23075
23179
  };
23076
23180
  InteractiveDrawItemInterceptorContribution = __decorate([
23077
23181
  injectable()
@@ -23418,7 +23522,20 @@
23418
23522
  if (!renderer) {
23419
23523
  return;
23420
23524
  }
23525
+ let retrans = false;
23526
+ let tempBounds;
23527
+ if (graphic.parent) {
23528
+ const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;
23529
+ retrans = !!(scrollX || scrollY);
23530
+ if (retrans) {
23531
+ tempBounds = this.dirtyBounds.clone();
23532
+ const m = graphic.globalTransMatrix.getInverse();
23533
+ this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(m);
23534
+ this.dirtyBounds.translate(-scrollX, -scrollY);
23535
+ }
23536
+ }
23421
23537
  if (!(graphic.isContainer || vutils.isRectIntersect(graphic.AABBBounds, this.dirtyBounds, false))) {
23538
+ retrans && this.dirtyBounds.copy(tempBounds);
23422
23539
  return;
23423
23540
  }
23424
23541
  const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;
@@ -23432,6 +23549,7 @@
23432
23549
  else {
23433
23550
  renderer.draw(graphic, this.currentRenderService, drawContext, params);
23434
23551
  }
23552
+ retrans && this.dirtyBounds.copy(tempBounds);
23435
23553
  if (this.InterceptorContributions.length) {
23436
23554
  for (let i = 0; i < this.InterceptorContributions.length; i++) {
23437
23555
  const drawContribution = this.InterceptorContributions[i];
@@ -23558,7 +23676,7 @@
23558
23676
  if (clip) {
23559
23677
  context.clip();
23560
23678
  }
23561
- context.setShadowStyle && context.setShadowStyle(group, group.attribute, groupAttribute);
23679
+ context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
23562
23680
  if (doFillOrStroke.doFill) {
23563
23681
  if (fillCb) {
23564
23682
  fillCb(context, group.attribute, groupAttribute);
@@ -23703,7 +23821,7 @@
23703
23821
  }
23704
23822
  context.beginPath();
23705
23823
  drawIncrementalSegments(context.nativeContext, lastSeg, seg, { offsetX, offsetY });
23706
- context.setShadowStyle && context.setShadowStyle(line, attribute, defaultAttribute);
23824
+ context.setShadowBlendStyle && context.setShadowBlendStyle(line, attribute, defaultAttribute);
23707
23825
  context.setStrokeStyle(line, attribute, offsetX, offsetY, defaultAttribute);
23708
23826
  context.stroke();
23709
23827
  }
@@ -23754,7 +23872,7 @@
23754
23872
  offsetX,
23755
23873
  offsetY
23756
23874
  });
23757
- context.setShadowStyle && context.setShadowStyle(area, attribute, defaultAttribute);
23875
+ context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
23758
23876
  context.setCommonStyle(area, attribute, offsetX, offsetY, defaultAttribute);
23759
23877
  context.fill();
23760
23878
  }
@@ -24312,7 +24430,7 @@
24312
24430
  if (face === 'bottom' || face === 'top') {
24313
24431
  context.beginPath();
24314
24432
  drawArcPath(arc, context, x, y, z_face[face], outerRadius, innerRadius);
24315
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
24433
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
24316
24434
  if (doFill) {
24317
24435
  if (fillCb) {
24318
24436
  fillCb(context, arc.attribute, arcAttribute);
@@ -24356,7 +24474,7 @@
24356
24474
  innerouterStartAngle: innerStartAngle
24357
24475
  };
24358
24476
  });
24359
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
24477
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
24360
24478
  if (doFill) {
24361
24479
  if (fillCb) {
24362
24480
  fillCb(context, arc.attribute, arcAttribute);
@@ -26131,9 +26249,6 @@
26131
26249
  return;
26132
26250
  }
26133
26251
  renderNextFrame(layers, force) {
26134
- if (this.state === 'rendering' && !force) {
26135
- return;
26136
- }
26137
26252
  if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {
26138
26253
  (layers || this).forEach((layer) => {
26139
26254
  this.nextFrameRenderLayerSet.add(layer);
@@ -26184,6 +26299,12 @@
26184
26299
  updateBounds: !!this.dirtyBounds
26185
26300
  }, Object.assign({ renderStyle: this.renderStyle }, params));
26186
26301
  });
26302
+ if (this.interactiveLayer && !layerList.includes(this.interactiveLayer)) {
26303
+ this.interactiveLayer.render({
26304
+ renderService: this.renderService,
26305
+ updateBounds: !!this.dirtyBounds
26306
+ }, Object.assign({ renderStyle: this.renderStyle }, params));
26307
+ }
26187
26308
  }
26188
26309
  resizeWindow(w, h, rerender = true) {
26189
26310
  this.window.resize(w, h);