@visactor/vrender-core 0.16.0-alpha.3 → 0.16.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/cjs/allocator/point-allocate.js +2 -0
  2. package/cjs/animate/default-ticker.js +2 -1
  3. package/cjs/canvas/empty-context.js +1 -2
  4. package/cjs/common/bounds-context.js +2 -1
  5. package/cjs/common/generator.js +1 -2
  6. package/cjs/common/store.js +2 -1
  7. package/cjs/core/application.js +1 -1
  8. package/cjs/core/camera.js +1 -1
  9. package/cjs/core/constants.js +1 -1
  10. package/cjs/core/core-modules.js +1 -1
  11. package/cjs/core/global-module.js +2 -0
  12. package/cjs/core/layer-service.js +2 -1
  13. package/cjs/core/layer-service.js.map +1 -1
  14. package/cjs/core/stage.d.ts +1 -1
  15. package/cjs/core/stage.js +9 -4
  16. package/cjs/core/stage.js.map +1 -1
  17. package/cjs/graphic/arc.js +1 -1
  18. package/cjs/graphic/arc3d.js +1 -1
  19. package/cjs/graphic/area.js +1 -1
  20. package/cjs/graphic/bounds.js +1 -1
  21. package/cjs/graphic/circle.js +1 -1
  22. package/cjs/graphic/config.js +3 -1
  23. package/cjs/graphic/config.js.map +1 -1
  24. package/cjs/graphic/graphic-service/common-contribution.js +1 -1
  25. package/cjs/graphic/graphic-service/common-contribution.js.map +1 -1
  26. package/cjs/graphic/graphic-service/symbol-contribution.js +1 -1
  27. package/cjs/graphic/graphic-service/symbol-contribution.js.map +1 -1
  28. package/cjs/graphic/graphic.d.ts +3 -0
  29. package/cjs/graphic/graphic.js +45 -19
  30. package/cjs/graphic/graphic.js.map +1 -1
  31. package/cjs/interface/context.d.ts +2 -1
  32. package/cjs/interface/context.js.map +1 -1
  33. package/cjs/interface/event.d.ts +1 -0
  34. package/cjs/interface/event.js.map +1 -1
  35. package/cjs/interface/graphic.d.ts +4 -2
  36. package/cjs/interface/graphic.js.map +1 -1
  37. package/cjs/interface/stage.d.ts +3 -2
  38. package/cjs/interface/stage.js.map +1 -1
  39. package/cjs/picker/pick-interceptor.d.ts +6 -0
  40. package/cjs/picker/pick-interceptor.js +22 -1
  41. package/cjs/picker/pick-interceptor.js.map +1 -1
  42. package/cjs/picker/pick-modules.js +2 -0
  43. package/cjs/picker/pick-modules.js.map +1 -1
  44. package/cjs/render/contributions/render/arc-render.js +2 -2
  45. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  46. package/cjs/render/contributions/render/arc3d-render.js +2 -2
  47. package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
  48. package/cjs/render/contributions/render/area-render.js +1 -1
  49. package/cjs/render/contributions/render/area-render.js.map +1 -1
  50. package/cjs/render/contributions/render/base-render.js.map +1 -1
  51. package/cjs/render/contributions/render/circle-render.js +1 -1
  52. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  53. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  54. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  55. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  56. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  57. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  58. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  59. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  60. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  61. package/cjs/render/contributions/render/draw-contribution.js +11 -2
  62. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  63. package/cjs/render/contributions/render/draw-interceptor.d.ts +5 -1
  64. package/cjs/render/contributions/render/draw-interceptor.js +35 -16
  65. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  66. package/cjs/render/contributions/render/group-render.js +1 -1
  67. package/cjs/render/contributions/render/group-render.js.map +1 -1
  68. package/cjs/render/contributions/render/image-render.js +3 -2
  69. package/cjs/render/contributions/render/image-render.js.map +1 -1
  70. package/cjs/render/contributions/render/incremental-area-render.js +1 -1
  71. package/cjs/render/contributions/render/incremental-area-render.js.map +1 -1
  72. package/cjs/render/contributions/render/incremental-line-render.js +1 -1
  73. package/cjs/render/contributions/render/incremental-line-render.js.map +1 -1
  74. package/cjs/render/contributions/render/line-render.js +1 -1
  75. package/cjs/render/contributions/render/line-render.js.map +1 -1
  76. package/cjs/render/contributions/render/path-render.js +1 -1
  77. package/cjs/render/contributions/render/path-render.js.map +1 -1
  78. package/cjs/render/contributions/render/polygon-render.js +2 -2
  79. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  80. package/cjs/render/contributions/render/rect-render.js +1 -1
  81. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  82. package/cjs/render/contributions/render/symbol-render.js +1 -1
  83. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  84. package/cjs/render/contributions/render/text-render.js +2 -2
  85. package/cjs/render/contributions/render/text-render.js.map +1 -1
  86. package/cjs/render/contributions/render/utils.js +1 -1
  87. package/cjs/render/contributions/render/utils.js.map +1 -1
  88. package/dist/index.js +190 -70
  89. package/dist/index.min.js +1 -1
  90. package/es/allocator/point-allocate.js +2 -0
  91. package/es/animate/default-ticker.js +2 -1
  92. package/es/canvas/empty-context.js +1 -2
  93. package/es/common/bounds-context.js +2 -1
  94. package/es/common/generator.js +1 -2
  95. package/es/common/store.js +2 -1
  96. package/es/core/application.js +1 -1
  97. package/es/core/camera.js +1 -1
  98. package/es/core/constants.js +1 -1
  99. package/es/core/core-modules.js +1 -1
  100. package/es/core/global-module.js +2 -0
  101. package/es/core/layer-service.js +2 -1
  102. package/es/core/layer-service.js.map +1 -1
  103. package/es/core/stage.d.ts +1 -1
  104. package/es/core/stage.js +9 -4
  105. package/es/core/stage.js.map +1 -1
  106. package/es/graphic/arc.js +1 -1
  107. package/es/graphic/arc3d.js +1 -1
  108. package/es/graphic/area.js +1 -1
  109. package/es/graphic/bounds.js +1 -1
  110. package/es/graphic/circle.js +1 -1
  111. package/es/graphic/config.js +3 -1
  112. package/es/graphic/config.js.map +1 -1
  113. package/es/graphic/graphic-service/common-contribution.js +1 -1
  114. package/es/graphic/graphic-service/common-contribution.js.map +1 -1
  115. package/es/graphic/graphic-service/symbol-contribution.js +1 -1
  116. package/es/graphic/graphic-service/symbol-contribution.js.map +1 -1
  117. package/es/graphic/graphic.d.ts +3 -0
  118. package/es/graphic/graphic.js +44 -19
  119. package/es/graphic/graphic.js.map +1 -1
  120. package/es/interface/context.d.ts +2 -1
  121. package/es/interface/context.js.map +1 -1
  122. package/es/interface/event.d.ts +1 -0
  123. package/es/interface/event.js.map +1 -1
  124. package/es/interface/graphic.d.ts +4 -2
  125. package/es/interface/graphic.js.map +1 -1
  126. package/es/interface/stage.d.ts +3 -2
  127. package/es/interface/stage.js.map +1 -1
  128. package/es/picker/pick-interceptor.d.ts +6 -0
  129. package/es/picker/pick-interceptor.js +22 -0
  130. package/es/picker/pick-interceptor.js.map +1 -1
  131. package/es/picker/pick-modules.js +2 -1
  132. package/es/picker/pick-modules.js.map +1 -1
  133. package/es/render/contributions/render/arc-render.js +2 -2
  134. package/es/render/contributions/render/arc-render.js.map +1 -1
  135. package/es/render/contributions/render/arc3d-render.js +2 -2
  136. package/es/render/contributions/render/arc3d-render.js.map +1 -1
  137. package/es/render/contributions/render/area-render.js +1 -1
  138. package/es/render/contributions/render/area-render.js.map +1 -1
  139. package/es/render/contributions/render/base-render.js.map +1 -1
  140. package/es/render/contributions/render/circle-render.js +1 -1
  141. package/es/render/contributions/render/circle-render.js.map +1 -1
  142. package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  143. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  144. package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  145. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  146. package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  147. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  148. package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  149. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  150. package/es/render/contributions/render/draw-contribution.js +11 -2
  151. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  152. package/es/render/contributions/render/draw-interceptor.d.ts +5 -1
  153. package/es/render/contributions/render/draw-interceptor.js +36 -17
  154. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  155. package/es/render/contributions/render/group-render.js +1 -1
  156. package/es/render/contributions/render/group-render.js.map +1 -1
  157. package/es/render/contributions/render/image-render.js +3 -2
  158. package/es/render/contributions/render/image-render.js.map +1 -1
  159. package/es/render/contributions/render/incremental-area-render.js +1 -1
  160. package/es/render/contributions/render/incremental-area-render.js.map +1 -1
  161. package/es/render/contributions/render/incremental-line-render.js +1 -1
  162. package/es/render/contributions/render/incremental-line-render.js.map +1 -1
  163. package/es/render/contributions/render/line-render.js +1 -1
  164. package/es/render/contributions/render/line-render.js.map +1 -1
  165. package/es/render/contributions/render/path-render.js +1 -1
  166. package/es/render/contributions/render/path-render.js.map +1 -1
  167. package/es/render/contributions/render/polygon-render.js +2 -2
  168. package/es/render/contributions/render/polygon-render.js.map +1 -1
  169. package/es/render/contributions/render/rect-render.js +1 -1
  170. package/es/render/contributions/render/rect-render.js.map +1 -1
  171. package/es/render/contributions/render/symbol-render.js +1 -1
  172. package/es/render/contributions/render/symbol-render.js.map +1 -1
  173. package/es/render/contributions/render/text-render.js +2 -2
  174. package/es/render/contributions/render/text-render.js.map +1 -1
  175. package/es/render/contributions/render/utils.js +1 -1
  176. package/es/render/contributions/render/utils.js.map +1 -1
  177. 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);
@@ -13289,8 +13333,7 @@
13289
13333
  this.tryInit();
13290
13334
  const layerMode = this.getRecommendedLayerType(options.layerMode);
13291
13335
  const layerHandler = this.getLayerHandler(layerMode);
13292
- const layer = new Layer(stage, this.global, stage.window, Object.assign(Object.assign({ main: false }, options), { layerMode,
13293
- layerHandler }));
13336
+ const layer = new Layer(stage, this.global, stage.window, Object.assign(Object.assign({ main: false }, options), { layerMode: options.canvasId ? 'static' : layerMode, canvasId: options.canvasId, layerHandler }));
13294
13337
  const stageLayers = this.layerMap.get(stage) || [];
13295
13338
  stageLayers.push(layer);
13296
13339
  this.layerMap.set(stage, stageLayers);
@@ -13516,7 +13559,7 @@
13516
13559
  context.beginPath();
13517
13560
  const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
13518
13561
  renderCommandList(path.commandList, context, x, y);
13519
- context.setShadowStyle && context.setShadowStyle(graphic, graphic.attribute, themeAttributes);
13562
+ context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);
13520
13563
  if (doStroke) {
13521
13564
  if (strokeCb) {
13522
13565
  strokeCb(context, graphic.attribute, themeAttributes);
@@ -17703,7 +17746,7 @@
17703
17746
  if (outerBorder) {
17704
17747
  const defaultOuterBorder = theme.outerBorder;
17705
17748
  const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;
17706
- aabbBounds.expand(distance + shadowBlur + lineWidth / 2);
17749
+ aabbBounds.expand(distance + (shadowBlur + lineWidth) / 2);
17707
17750
  }
17708
17751
  return aabbBounds;
17709
17752
  }
@@ -17726,7 +17769,7 @@
17726
17769
  if (outerBorder) {
17727
17770
  const defaultOuterBorder = symbolTheme.outerBorder;
17728
17771
  const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;
17729
- boundStroke(aabbBounds, distance + shadowBlur + lineWidth / 2, true, strokeBoundsBuffer);
17772
+ boundStroke(aabbBounds, distance + (shadowBlur + lineWidth) / 2, true, strokeBoundsBuffer);
17730
17773
  }
17731
17774
  return aabbBounds;
17732
17775
  }
@@ -19250,8 +19293,8 @@
19250
19293
  context.beginPath();
19251
19294
  drawArcPath$1(arc, context, x, y, outerRadius, innerRadius);
19252
19295
  beforeRenderContribitionsRuned = true;
19296
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
19253
19297
  this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
19254
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
19255
19298
  if (doFill) {
19256
19299
  if (fillCb) {
19257
19300
  fillCb(context, arc.attribute, arcAttribute);
@@ -19355,8 +19398,8 @@
19355
19398
  context.beginPath();
19356
19399
  context.arc(x, y, radius, startAngle, endAngle);
19357
19400
  context.closePath();
19401
+ context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
19358
19402
  this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
19359
- context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute);
19360
19403
  if (doFill) {
19361
19404
  if (fillCb) {
19362
19405
  fillCb(context, circle.attribute, circleAttribute);
@@ -19630,7 +19673,7 @@
19630
19673
  line.attribute.curveType.includes('Closed')) {
19631
19674
  context.closePath();
19632
19675
  }
19633
- context.setShadowStyle && context.setShadowStyle(line, attribute, defaultAttribute);
19676
+ context.setShadowBlendStyle && context.setShadowBlendStyle(line, attribute, defaultAttribute);
19634
19677
  const { x: originX = 0, x: originY = 0 } = attribute;
19635
19678
  const ret = false;
19636
19679
  if (fill !== false) {
@@ -20362,7 +20405,7 @@
20362
20405
  zeroY: connectedY
20363
20406
  });
20364
20407
  this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
20365
- context.setShadowStyle && context.setShadowStyle(area, attribute, defaultAttribute);
20408
+ context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
20366
20409
  const { x: originX = 0, x: originY = 0 } = attribute;
20367
20410
  if (fill !== false) {
20368
20411
  if (fillCb) {
@@ -20431,8 +20474,8 @@
20431
20474
  const path2D = (_b = path.attribute.path) !== null && _b !== void 0 ? _b : pathAttribute.path;
20432
20475
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
20433
20476
  }
20477
+ context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute);
20434
20478
  this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
20435
- context.setShadowStyle && context.setShadowStyle(path, path.attribute, pathAttribute);
20436
20479
  if (doStroke) {
20437
20480
  if (strokeCb) {
20438
20481
  strokeCb(context, path.attribute, pathAttribute);
@@ -20588,8 +20631,8 @@
20588
20631
  doFill,
20589
20632
  doStroke
20590
20633
  };
20634
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
20591
20635
  this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
20592
- context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute);
20593
20636
  if (doFillOrStroke.doFill) {
20594
20637
  if (fillCb) {
20595
20638
  fillCb(context, rect.attribute, rectAttribute);
@@ -20697,8 +20740,8 @@
20697
20740
  context.closePath();
20698
20741
  }
20699
20742
  }
20743
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
20700
20744
  this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
20701
- context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute);
20702
20745
  if (doFill && !parsedPath.isSvg) {
20703
20746
  if (fillCb) {
20704
20747
  fillCb(context, symbol.attribute, symbolAttribute);
@@ -20757,8 +20800,8 @@
20757
20800
  const transform3dMatrixToContextMatrix = !keepDirIn3d;
20758
20801
  const z = this.z || 0;
20759
20802
  context.beginPath();
20803
+ context.setShadowBlendStyle && context.setShadowBlendStyle(text, text.attribute, textAttribute);
20760
20804
  this.beforeRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
20761
- context.setShadowStyle && context.setShadowStyle(text, text.attribute, textAttribute);
20762
20805
  transform3dMatrixToContextMatrix && this.transformUseContext2d(text, textAttribute, z, context);
20763
20806
  const drawText = (t, offsetX, offsetY, direction) => {
20764
20807
  let _x = x + offsetX;
@@ -21100,8 +21143,8 @@
21100
21143
  drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath);
21101
21144
  }
21102
21145
  closePath && context.closePath();
21146
+ context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute);
21103
21147
  this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
21104
- context.setShadowStyle && context.setShadowStyle(polygon, polygon.attribute, polygonAttribute);
21105
21148
  if (doFill) {
21106
21149
  if (fillCb) {
21107
21150
  fillCb(context, polygon.attribute, polygonAttribute);
@@ -21150,8 +21193,8 @@
21150
21193
  return;
21151
21194
  }
21152
21195
  const { fVisible, sVisible, doFill, doStroke } = data;
21196
+ context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute);
21153
21197
  this.beforeRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
21154
- context.setShadowStyle && context.setShadowStyle(image, imageAttribute);
21155
21198
  if (doFill) {
21156
21199
  if (fillCb) {
21157
21200
  fillCb(context, image.attribute, imageAttribute);
@@ -21651,7 +21694,7 @@
21651
21694
  });
21652
21695
  context.beginPath();
21653
21696
  drawArcPath$1(arc, context, x, y, outerRadius + d, innerRadius - d);
21654
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
21697
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
21655
21698
  if (strokeCb) {
21656
21699
  strokeCb(context, outerBorder, arcAttribute.outerBorder);
21657
21700
  }
@@ -21675,7 +21718,7 @@
21675
21718
  });
21676
21719
  context.beginPath();
21677
21720
  drawArcPath$1(arc, context, x, y, outerRadius - d, innerRadius + d);
21678
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
21721
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
21679
21722
  if (strokeCb) {
21680
21723
  strokeCb(context, innerBorder, arcAttribute.innerBorder);
21681
21724
  }
@@ -21735,7 +21778,7 @@
21735
21778
  context.beginPath();
21736
21779
  context.arc(x, y, radius + dw, startAngle, endAngle);
21737
21780
  context.closePath();
21738
- context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute);
21781
+ context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
21739
21782
  if (strokeCb) {
21740
21783
  strokeCb(context, outerBorder, circleAttribute.outerBorder);
21741
21784
  }
@@ -21754,7 +21797,7 @@
21754
21797
  context.beginPath();
21755
21798
  context.arc(x, y, radius - dw, startAngle, endAngle);
21756
21799
  context.closePath();
21757
- context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute);
21800
+ context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
21758
21801
  if (strokeCb) {
21759
21802
  strokeCb(context, innerBorder, circleAttribute.innerBorder);
21760
21803
  }
@@ -21949,7 +21992,7 @@
21949
21992
  context.beginPath();
21950
21993
  createRectPath(context, nextX, nextY, width + dw, height + dw, cornerRadius);
21951
21994
  }
21952
- context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute);
21995
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
21953
21996
  if (strokeCb) {
21954
21997
  strokeCb(context, outerBorder, rectAttribute.outerBorder);
21955
21998
  }
@@ -21975,7 +22018,7 @@
21975
22018
  context.beginPath();
21976
22019
  createRectPath(context, nextX, nextY, width - dw, height - dw, cornerRadius);
21977
22020
  }
21978
- context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute);
22021
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
21979
22022
  if (strokeCb) {
21980
22023
  strokeCb(context, innerBorder, rectAttribute.innerBorder);
21981
22024
  }
@@ -22099,7 +22142,7 @@
22099
22142
  if (parsedPath.drawOffset(context, size, x, y, d) === false) {
22100
22143
  context.closePath();
22101
22144
  }
22102
- context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute);
22145
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
22103
22146
  if (strokeCb) {
22104
22147
  strokeCb(context, outerBorder, symbolAttribute.outerBorder);
22105
22148
  }
@@ -22118,7 +22161,7 @@
22118
22161
  if (parsedPath.drawOffset(context, size, x, y, -d) === false) {
22119
22162
  context.closePath();
22120
22163
  }
22121
- context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute);
22164
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
22122
22165
  if (strokeCb) {
22123
22166
  strokeCb(context, innerBorder, symbolAttribute.innerBorder);
22124
22167
  }
@@ -22359,6 +22402,30 @@
22359
22402
  exports.ShadowRootPickItemInterceptorContribution = __decorate([
22360
22403
  injectable()
22361
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);
22362
22429
  exports.Canvas3DPickItemInterceptor = class Canvas3DPickItemInterceptor {
22363
22430
  constructor() {
22364
22431
  this.order = 1;
@@ -22493,6 +22560,8 @@
22493
22560
  bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor);
22494
22561
  bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope();
22495
22562
  bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution);
22563
+ bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope();
22564
+ bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution);
22496
22565
  bindContributionProvider(bind, PickItemInterceptor);
22497
22566
  });
22498
22567
 
@@ -23023,6 +23092,7 @@
23023
23092
  }
23024
23093
  const { context } = drawContext;
23025
23094
  context.highPerformanceSave();
23095
+ context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true);
23026
23096
  const b = graphic.AABBBounds;
23027
23097
  if (graphic.attribute._debug_bounds !== true) {
23028
23098
  graphic.attribute._debug_bounds(context, graphic);
@@ -23040,27 +23110,31 @@
23040
23110
  this.order = 1;
23041
23111
  }
23042
23112
  beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
23043
- let interactiveGraphic;
23044
- if (graphic.attribute.interactive) {
23045
- 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) {
23046
23124
  if (!interactiveGraphic) {
23047
23125
  interactiveGraphic = graphic.clone();
23048
23126
  graphic.interactiveGraphic = interactiveGraphic;
23127
+ interactiveGraphic.baseGraphic = graphic;
23049
23128
  }
23050
- const m = graphic.globalTransMatrix;
23051
23129
  interactiveGraphic.setAttributes({
23052
- x: 0,
23053
- y: 0,
23054
- scaleX: 1,
23055
- scaleY: 1,
23056
- angle: 0,
23057
- postMatrix: m,
23058
- interactive: false
23130
+ globalZIndex: 0,
23131
+ zIndex: graphic.attribute.globalZIndex
23059
23132
  }, false, { skipUpdateCallback: true });
23060
23133
  drawContext.stage.tryInitInteractiveLayer();
23061
23134
  const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');
23062
23135
  if (interactiveLayer) {
23063
- interactiveLayer.add(interactiveGraphic);
23136
+ const shadowRoot = this.getShadowRoot(interactiveLayer);
23137
+ shadowRoot.add(interactiveGraphic);
23064
23138
  }
23065
23139
  return true;
23066
23140
  }
@@ -23068,11 +23142,40 @@
23068
23142
  drawContext.stage.tryInitInteractiveLayer();
23069
23143
  const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');
23070
23144
  if (interactiveLayer) {
23071
- interactiveLayer.removeChild(interactiveGraphic);
23145
+ const shadowRoot = this.getShadowRoot(interactiveLayer);
23146
+ shadowRoot.removeChild(interactiveGraphic);
23072
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;
23073
23166
  }
23074
23167
  return false;
23075
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
+ }
23076
23179
  };
23077
23180
  InteractiveDrawItemInterceptorContribution = __decorate([
23078
23181
  injectable()
@@ -23419,7 +23522,20 @@
23419
23522
  if (!renderer) {
23420
23523
  return;
23421
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
+ }
23422
23537
  if (!(graphic.isContainer || vutils.isRectIntersect(graphic.AABBBounds, this.dirtyBounds, false))) {
23538
+ retrans && this.dirtyBounds.copy(tempBounds);
23423
23539
  return;
23424
23540
  }
23425
23541
  const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;
@@ -23433,6 +23549,7 @@
23433
23549
  else {
23434
23550
  renderer.draw(graphic, this.currentRenderService, drawContext, params);
23435
23551
  }
23552
+ retrans && this.dirtyBounds.copy(tempBounds);
23436
23553
  if (this.InterceptorContributions.length) {
23437
23554
  for (let i = 0; i < this.InterceptorContributions.length; i++) {
23438
23555
  const drawContribution = this.InterceptorContributions[i];
@@ -23559,7 +23676,7 @@
23559
23676
  if (clip) {
23560
23677
  context.clip();
23561
23678
  }
23562
- context.setShadowStyle && context.setShadowStyle(group, group.attribute, groupAttribute);
23679
+ context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
23563
23680
  if (doFillOrStroke.doFill) {
23564
23681
  if (fillCb) {
23565
23682
  fillCb(context, group.attribute, groupAttribute);
@@ -23704,7 +23821,7 @@
23704
23821
  }
23705
23822
  context.beginPath();
23706
23823
  drawIncrementalSegments(context.nativeContext, lastSeg, seg, { offsetX, offsetY });
23707
- context.setShadowStyle && context.setShadowStyle(line, attribute, defaultAttribute);
23824
+ context.setShadowBlendStyle && context.setShadowBlendStyle(line, attribute, defaultAttribute);
23708
23825
  context.setStrokeStyle(line, attribute, offsetX, offsetY, defaultAttribute);
23709
23826
  context.stroke();
23710
23827
  }
@@ -23755,7 +23872,7 @@
23755
23872
  offsetX,
23756
23873
  offsetY
23757
23874
  });
23758
- context.setShadowStyle && context.setShadowStyle(area, attribute, defaultAttribute);
23875
+ context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
23759
23876
  context.setCommonStyle(area, attribute, offsetX, offsetY, defaultAttribute);
23760
23877
  context.fill();
23761
23878
  }
@@ -24313,7 +24430,7 @@
24313
24430
  if (face === 'bottom' || face === 'top') {
24314
24431
  context.beginPath();
24315
24432
  drawArcPath(arc, context, x, y, z_face[face], outerRadius, innerRadius);
24316
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
24433
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
24317
24434
  if (doFill) {
24318
24435
  if (fillCb) {
24319
24436
  fillCb(context, arc.attribute, arcAttribute);
@@ -24357,7 +24474,7 @@
24357
24474
  innerouterStartAngle: innerStartAngle
24358
24475
  };
24359
24476
  });
24360
- context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute);
24477
+ context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
24361
24478
  if (doFill) {
24362
24479
  if (fillCb) {
24363
24480
  fillCb(context, arc.attribute, arcAttribute);
@@ -26082,7 +26199,7 @@
26082
26199
  combineLayer(ILayer1, ILayer2) {
26083
26200
  throw new Error('暂不支持');
26084
26201
  }
26085
- createLayer(layerMode) {
26202
+ createLayer(canvasId, layerMode) {
26086
26203
  const layer = this.layerService.createLayer(this, {
26087
26204
  main: false,
26088
26205
  layerMode
@@ -26132,9 +26249,6 @@
26132
26249
  return;
26133
26250
  }
26134
26251
  renderNextFrame(layers, force) {
26135
- if (this.state === 'rendering' && !force) {
26136
- return;
26137
- }
26138
26252
  if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {
26139
26253
  (layers || this).forEach((layer) => {
26140
26254
  this.nextFrameRenderLayerSet.add(layer);
@@ -26185,6 +26299,12 @@
26185
26299
  updateBounds: !!this.dirtyBounds
26186
26300
  }, Object.assign({ renderStyle: this.renderStyle }, params));
26187
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
+ }
26188
26308
  }
26189
26309
  resizeWindow(w, h, rerender = true) {
26190
26310
  this.window.resize(w, h);