@visactor/vrender 0.19.21 → 0.19.23

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
@@ -4046,7 +4046,8 @@
4046
4046
  shadowRootIdx: 1,
4047
4047
  globalZIndex: 1,
4048
4048
  globalCompositeOperation: "",
4049
- overflow: "hidden"
4049
+ overflow: "hidden",
4050
+ shadowPickMode: "graphic"
4050
4051
  }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
4051
4052
  function addAttributeToPrototype(obj, c, keys) {
4052
4053
  keys.forEach(key => {
@@ -5849,13 +5850,23 @@
5849
5850
  }
5850
5851
  }
5851
5852
  preventDefault() {
5852
- this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault(), this.defaultPrevented = !0;
5853
+ try {
5854
+ this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault();
5855
+ } catch (err) {
5856
+ this.nativeEvent.preventDefault && isFunction$1(this.nativeEvent.preventDefault) && this.nativeEvent.preventDefault();
5857
+ }
5858
+ this.defaultPrevented = !0;
5853
5859
  }
5854
5860
  stopImmediatePropagation() {
5855
5861
  this.propagationImmediatelyStopped = !0;
5856
5862
  }
5857
5863
  stopPropagation() {
5858
- this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.stopPropagation(), this.propagationStopped = !0;
5864
+ try {
5865
+ this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.stopPropagation();
5866
+ } catch (err) {
5867
+ this.nativeEvent.stopPropagation && isFunction$1(this.nativeEvent.stopPropagation) && this.nativeEvent.stopPropagation();
5868
+ }
5869
+ this.propagationStopped = !0;
5859
5870
  }
5860
5871
  initEvent() {}
5861
5872
  initUIEvent() {}
@@ -10971,13 +10982,14 @@
10971
10982
  return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
10972
10983
  }
10973
10984
  function textAttributesToStyle(attrs) {
10974
- const style = {};
10985
+ const style = {},
10986
+ parsePxValue = value => /^\d+(\.\d+)?$/.test(`${value}`) ? `${value}px` : `${value}`;
10975
10987
  return ["textAlign", "fontFamily", "fontVariant", "fontStyle", "fontWeight"].forEach(key => {
10976
10988
  attrs[key] && (style[lowerCamelCaseToMiddle(key)] = attrs[key]);
10977
10989
  }), ["fontSize", "lineHeight"].forEach(key => {
10978
10990
  const styleKey = lowerCamelCaseToMiddle(key);
10979
- isNil$1(attrs[key]) || (style[styleKey] = /^[0-9]*$/.test(`${attrs[key]}`) ? `${attrs[key]}px` : `${attrs[key]}`);
10980
- }), attrs.underline ? style["text-decoration"] = "underline" : attrs.lineThrough && (style["text-decoration"] = "line-through"), attrs.fill && isString$1(attrs.fill) && (style.color = attrs.fill), style;
10991
+ isNil$1(attrs[key]) || (style[styleKey] = parsePxValue(attrs[key]));
10992
+ }), isValid$1(attrs.maxLineWidth) && (style["max-width"] = parsePxValue(attrs.maxLineWidth)), attrs.underline ? style["text-decoration"] = "underline" : attrs.lineThrough && (style["text-decoration"] = "line-through"), attrs.fill && isString$1(attrs.fill) && (style.color = attrs.fill), style;
10981
10993
  }
10982
10994
 
10983
10995
  class CanvasTextLayout {
@@ -17237,6 +17249,100 @@
17237
17249
  decorator(target, key, paramIndex);
17238
17250
  };
17239
17251
  };
17252
+ exports.DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
17253
+ constructor(groupRenderContribitions) {
17254
+ this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
17255
+ }
17256
+ drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
17257
+ const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
17258
+ {
17259
+ fill = groupAttribute.fill,
17260
+ background: background,
17261
+ stroke = groupAttribute.stroke,
17262
+ opacity = groupAttribute.opacity,
17263
+ width = groupAttribute.width,
17264
+ height = groupAttribute.height,
17265
+ clip = groupAttribute.clip,
17266
+ fillOpacity = groupAttribute.fillOpacity,
17267
+ strokeOpacity = groupAttribute.strokeOpacity,
17268
+ cornerRadius = groupAttribute.cornerRadius,
17269
+ path = groupAttribute.path,
17270
+ lineWidth = groupAttribute.lineWidth,
17271
+ visible = groupAttribute.visible
17272
+ } = group.attribute,
17273
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
17274
+ sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
17275
+ doFill = runFill(fill, background),
17276
+ doStroke = runStroke(stroke, lineWidth);
17277
+ if (!group.valid || !visible) return;
17278
+ if (!clip) {
17279
+ if (!doFill && !doStroke) return;
17280
+ if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
17281
+ }
17282
+ if (path && path.length && drawContext.drawContribution) {
17283
+ const disableFill = context.disableFill,
17284
+ disableStroke = context.disableStroke,
17285
+ disableBeginPath = context.disableBeginPath;
17286
+ context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
17287
+ drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
17288
+ }), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
17289
+ } else 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
17290
+ this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
17291
+ const doFillOrStroke = {
17292
+ doFill: doFill,
17293
+ doStroke: doStroke
17294
+ };
17295
+ this._groupRenderContribitions.forEach(c => {
17296
+ c.time === exports.BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
17297
+ }), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute), doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke())), this._groupRenderContribitions.forEach(c => {
17298
+ c.time === exports.BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
17299
+ });
17300
+ }
17301
+ draw(group, renderService, drawContext, params) {
17302
+ const {
17303
+ context: context
17304
+ } = drawContext;
17305
+ if (!context) return;
17306
+ const {
17307
+ clip: clip,
17308
+ baseOpacity = 1
17309
+ } = group.attribute;
17310
+ clip ? context.save() : context.highPerformanceSave(), context.baseGlobalAlpha *= baseOpacity;
17311
+ const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
17312
+ lastModelMatrix = context.modelMatrix;
17313
+ if (context.camera) {
17314
+ const nextModelMatrix = mat4Allocate.allocate(),
17315
+ modelMatrix = mat4Allocate.allocate();
17316
+ getModelMatrix(modelMatrix, group, groupAttribute), multiplyMat4Mat4(nextModelMatrix, lastModelMatrix || nextModelMatrix, modelMatrix), context.modelMatrix = nextModelMatrix, mat4Allocate.free(modelMatrix), context.setTransform(1, 0, 0, 1, 0, 0, !0);
17317
+ } else context.transformFromMatrix(group.transMatrix, !0);
17318
+ context.beginPath(), params.skipDraw ? this.drawShape(group, context, 0, 0, drawContext, params, () => !1, () => !1) : this.drawShape(group, context, 0, 0, drawContext);
17319
+ const {
17320
+ scrollX = groupAttribute.scrollX,
17321
+ scrollY = groupAttribute.scrollY
17322
+ } = group.attribute;
17323
+ let p;
17324
+ (scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha /= baseOpacity, p && p.then ? p.then(() => {
17325
+ clip ? context.restore() : context.highPerformanceRestore();
17326
+ }) : clip ? context.restore() : context.highPerformanceRestore();
17327
+ }
17328
+ };
17329
+ exports.DefaultCanvasGroupRender = __decorate$1s([injectable(), __param$H(0, inject(ContributionProvider)), __param$H(0, named(GroupRenderContribution)), __metadata$16("design:paramtypes", [Object])], exports.DefaultCanvasGroupRender);
17330
+
17331
+ var __decorate$1r = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17332
+ var d,
17333
+ c = arguments.length,
17334
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
17335
+ if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
17336
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
17337
+ },
17338
+ __metadata$15 = undefined && undefined.__metadata || function (k, v) {
17339
+ if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
17340
+ },
17341
+ __param$G = undefined && undefined.__param || function (paramIndex, decorator) {
17342
+ return function (target, key) {
17343
+ decorator(target, key, paramIndex);
17344
+ };
17345
+ };
17240
17346
  const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
17241
17347
  exports.DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender {
17242
17348
  constructor(imageRenderContribitions) {
@@ -17293,7 +17399,7 @@
17293
17399
  this._draw(image, imageAttribute, !1, drawContext);
17294
17400
  }
17295
17401
  };
17296
- exports.DefaultCanvasImageRender = __decorate$1s([injectable(), __param$H(0, inject(ContributionProvider)), __param$H(0, named(ImageRenderContribution)), __metadata$16("design:paramtypes", [Object])], exports.DefaultCanvasImageRender);
17402
+ exports.DefaultCanvasImageRender = __decorate$1r([injectable(), __param$G(0, inject(ContributionProvider)), __param$G(0, named(ImageRenderContribution)), __metadata$15("design:paramtypes", [Object])], exports.DefaultCanvasImageRender);
17297
17403
 
17298
17404
  const IncrementalDrawContribution = Symbol.for("IncrementalDrawContribution");
17299
17405
  const ArcRender = Symbol.for("ArcRender");
@@ -17316,14 +17422,14 @@
17316
17422
  const RenderSelector = Symbol.for("RenderSelector");
17317
17423
  const DrawContribution = Symbol.for("DrawContribution");
17318
17424
 
17319
- var __decorate$1r = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17425
+ var __decorate$1q = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17320
17426
  var d,
17321
17427
  c = arguments.length,
17322
17428
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
17323
17429
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
17324
17430
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17325
17431
  },
17326
- __metadata$15 = undefined && undefined.__metadata || function (k, v) {
17432
+ __metadata$14 = undefined && undefined.__metadata || function (k, v) {
17327
17433
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
17328
17434
  };
17329
17435
  const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
@@ -17383,7 +17489,7 @@
17383
17489
  return !1;
17384
17490
  }
17385
17491
  };
17386
- exports.CommonDrawItemInterceptorContribution = __decorate$1r([injectable(), __metadata$15("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
17492
+ exports.CommonDrawItemInterceptorContribution = __decorate$1q([injectable(), __metadata$14("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
17387
17493
  class InteractiveDrawItemInterceptorContribution {
17388
17494
  constructor() {
17389
17495
  this.order = 1;
@@ -17515,17 +17621,17 @@
17515
17621
  }
17516
17622
  }
17517
17623
 
17518
- var __decorate$1q = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17624
+ var __decorate$1p = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17519
17625
  var d,
17520
17626
  c = arguments.length,
17521
17627
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
17522
17628
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
17523
17629
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17524
17630
  },
17525
- __metadata$14 = undefined && undefined.__metadata || function (k, v) {
17631
+ __metadata$13 = undefined && undefined.__metadata || function (k, v) {
17526
17632
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
17527
17633
  },
17528
- __param$G = undefined && undefined.__param || function (paramIndex, decorator) {
17634
+ __param$F = undefined && undefined.__param || function (paramIndex, decorator) {
17529
17635
  return function (target, key) {
17530
17636
  decorator(target, key, paramIndex);
17531
17637
  };
@@ -17563,7 +17669,7 @@
17563
17669
  this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params), this.drawParams = null;
17564
17670
  }
17565
17671
  };
17566
- exports.DefaultRenderService = __decorate$1q([injectable(), __param$G(0, inject(DrawContribution)), __metadata$14("design:paramtypes", [Object])], exports.DefaultRenderService);
17672
+ exports.DefaultRenderService = __decorate$1p([injectable(), __param$F(0, inject(DrawContribution)), __metadata$13("design:paramtypes", [Object])], exports.DefaultRenderService);
17567
17673
 
17568
17674
  var renderModule$1 = new ContainerModule(bind => {
17569
17675
  bind(RenderService).to(exports.DefaultRenderService);
@@ -17574,7 +17680,7 @@
17574
17680
  const BoundsPicker = Symbol.for("BoundsPicker");
17575
17681
  const GlobalPickerService = Symbol.for("GlobalPickerService");
17576
17682
 
17577
- var __decorate$1p = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17683
+ var __decorate$1o = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17578
17684
  var d,
17579
17685
  c = arguments.length,
17580
17686
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
@@ -17593,6 +17699,7 @@
17593
17699
  return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
17594
17700
  }
17595
17701
  _pickItem(graphic, pickerService, point, pickParams, params) {
17702
+ var _a;
17596
17703
  if (!graphic.shadowRoot) return null;
17597
17704
  const {
17598
17705
  parentMatrix: parentMatrix
@@ -17600,14 +17707,18 @@
17600
17707
  if (!parentMatrix) return null;
17601
17708
  const context = pickerService.pickContext;
17602
17709
  context.highPerformanceSave();
17603
- const g = graphic.shadowRoot,
17710
+ const theme = null === (_a = getTheme(graphic)) || void 0 === _a ? void 0 : _a[graphic.type],
17711
+ {
17712
+ shadowPickMode = null == theme ? void 0 : theme.shadowPickMode
17713
+ } = graphic.attribute,
17714
+ g = graphic.shadowRoot,
17604
17715
  currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
17605
17716
  newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
17606
17717
  result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
17607
- return context.highPerformanceRestore(), result;
17718
+ return context.highPerformanceRestore(), !result.graphic && result.group && "full" === shadowPickMode && (result.graphic = result.group), result;
17608
17719
  }
17609
17720
  };
17610
- exports.ShadowRootPickItemInterceptorContribution = __decorate$1p([injectable()], exports.ShadowRootPickItemInterceptorContribution);
17721
+ exports.ShadowRootPickItemInterceptorContribution = __decorate$1o([injectable()], exports.ShadowRootPickItemInterceptorContribution);
17611
17722
  exports.InteractivePickItemInterceptorContribution = class InteractivePickItemInterceptorContribution {
17612
17723
  constructor() {
17613
17724
  this.order = 1;
@@ -17626,7 +17737,7 @@
17626
17737
  return null;
17627
17738
  }
17628
17739
  };
17629
- exports.InteractivePickItemInterceptorContribution = __decorate$1p([injectable()], exports.InteractivePickItemInterceptorContribution);
17740
+ exports.InteractivePickItemInterceptorContribution = __decorate$1o([injectable()], exports.InteractivePickItemInterceptorContribution);
17630
17741
  exports.Canvas3DPickItemInterceptor = class Canvas3DPickItemInterceptor {
17631
17742
  constructor() {
17632
17743
  this.order = 1;
@@ -17686,7 +17797,7 @@
17686
17797
  context.setTransformForCurrent();
17687
17798
  }
17688
17799
  };
17689
- exports.Canvas3DPickItemInterceptor = __decorate$1p([injectable()], exports.Canvas3DPickItemInterceptor);
17800
+ exports.Canvas3DPickItemInterceptor = __decorate$1o([injectable()], exports.Canvas3DPickItemInterceptor);
17690
17801
 
17691
17802
  var pickModule = new ContainerModule((bind, unbind, isBound) => {
17692
17803
  isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
@@ -17699,17 +17810,17 @@
17699
17810
  const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
17700
17811
  const PluginService = Symbol.for("PluginService");
17701
17812
 
17702
- var __decorate$1o = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17813
+ var __decorate$1n = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17703
17814
  var d,
17704
17815
  c = arguments.length,
17705
17816
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
17706
17817
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
17707
17818
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17708
17819
  },
17709
- __metadata$13 = undefined && undefined.__metadata || function (k, v) {
17820
+ __metadata$12 = undefined && undefined.__metadata || function (k, v) {
17710
17821
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
17711
17822
  },
17712
- __param$F = undefined && undefined.__param || function (paramIndex, decorator) {
17823
+ __param$E = undefined && undefined.__param || function (paramIndex, decorator) {
17713
17824
  return function (target, key) {
17714
17825
  decorator(target, key, paramIndex);
17715
17826
  };
@@ -17749,7 +17860,7 @@
17749
17860
  }), this.onRegisterPlugin = [];
17750
17861
  }
17751
17862
  };
17752
- DefaultPluginService = __decorate$1o([injectable(), __param$F(0, inject(ContributionProvider)), __param$F(0, named(AutoEnablePlugins)), __metadata$13("design:paramtypes", [Object])], DefaultPluginService);
17863
+ DefaultPluginService = __decorate$1n([injectable(), __param$E(0, inject(ContributionProvider)), __param$E(0, named(AutoEnablePlugins)), __metadata$12("design:paramtypes", [Object])], DefaultPluginService);
17753
17864
 
17754
17865
  var pluginModule = new ContainerModule(bind => {
17755
17866
  bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
@@ -17763,14 +17874,14 @@
17763
17874
  bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
17764
17875
  });
17765
17876
 
17766
- var __decorate$1n = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17877
+ var __decorate$1m = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17767
17878
  var d,
17768
17879
  c = arguments.length,
17769
17880
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
17770
17881
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
17771
17882
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17772
17883
  },
17773
- __metadata$12 = undefined && undefined.__metadata || function (k, v) {
17884
+ __metadata$11 = undefined && undefined.__metadata || function (k, v) {
17774
17885
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
17775
17886
  };
17776
17887
  let CanvasLayerHandlerContribution = class {
@@ -17840,16 +17951,16 @@
17840
17951
  this.canvas.release();
17841
17952
  }
17842
17953
  };
17843
- CanvasLayerHandlerContribution = __decorate$1n([injectable(), __metadata$12("design:paramtypes", [])], CanvasLayerHandlerContribution);
17954
+ CanvasLayerHandlerContribution = __decorate$1m([injectable(), __metadata$11("design:paramtypes", [])], CanvasLayerHandlerContribution);
17844
17955
 
17845
- var __decorate$1m = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17956
+ var __decorate$1l = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17846
17957
  var d,
17847
17958
  c = arguments.length,
17848
17959
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
17849
17960
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
17850
17961
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17851
17962
  },
17852
- __metadata$11 = undefined && undefined.__metadata || function (k, v) {
17963
+ __metadata$10 = undefined && undefined.__metadata || function (k, v) {
17853
17964
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
17854
17965
  };
17855
17966
  let EmptyLayerHandlerContribution = class {
@@ -17884,16 +17995,16 @@
17884
17995
  }
17885
17996
  release() {}
17886
17997
  };
17887
- EmptyLayerHandlerContribution = __decorate$1m([injectable(), __metadata$11("design:paramtypes", [])], EmptyLayerHandlerContribution);
17998
+ EmptyLayerHandlerContribution = __decorate$1l([injectable(), __metadata$10("design:paramtypes", [])], EmptyLayerHandlerContribution);
17888
17999
 
17889
- var __decorate$1l = undefined && undefined.__decorate || function (decorators, target, key, desc) {
18000
+ var __decorate$1k = undefined && undefined.__decorate || function (decorators, target, key, desc) {
17890
18001
  var d,
17891
18002
  c = arguments.length,
17892
18003
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
17893
18004
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
17894
18005
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17895
18006
  },
17896
- __metadata$10 = undefined && undefined.__metadata || function (k, v) {
18007
+ __metadata$$ = undefined && undefined.__metadata || function (k, v) {
17897
18008
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
17898
18009
  };
17899
18010
  let OffscreenLayerHandlerContribution = class {
@@ -17956,7 +18067,7 @@
17956
18067
  }
17957
18068
  merge(layerHandlers) {}
17958
18069
  };
17959
- OffscreenLayerHandlerContribution = __decorate$1l([injectable(), __metadata$10("design:paramtypes", [])], OffscreenLayerHandlerContribution);
18070
+ OffscreenLayerHandlerContribution = __decorate$1k([injectable(), __metadata$$("design:paramtypes", [])], OffscreenLayerHandlerContribution);
17960
18071
 
17961
18072
  var layerHandlerModules = new ContainerModule(bind => {
17962
18073
  bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
@@ -18072,17 +18183,17 @@
18072
18183
  return result;
18073
18184
  }
18074
18185
 
18075
- var __decorate$1k = undefined && undefined.__decorate || function (decorators, target, key, desc) {
18186
+ var __decorate$1j = undefined && undefined.__decorate || function (decorators, target, key, desc) {
18076
18187
  var d,
18077
18188
  c = arguments.length,
18078
18189
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
18079
18190
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
18080
18191
  return c > 3 && r && Object.defineProperty(target, key, r), r;
18081
18192
  },
18082
- __metadata$$ = undefined && undefined.__metadata || function (k, v) {
18193
+ __metadata$_ = undefined && undefined.__metadata || function (k, v) {
18083
18194
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
18084
18195
  },
18085
- __param$E = undefined && undefined.__param || function (paramIndex, decorator) {
18196
+ __param$D = undefined && undefined.__param || function (paramIndex, decorator) {
18086
18197
  return function (target, key) {
18087
18198
  decorator(target, key, paramIndex);
18088
18199
  };
@@ -18269,101 +18380,7 @@
18269
18380
  }
18270
18381
  afterDraw(renderService, drawParams) {}
18271
18382
  };
18272
- DefaultDrawContribution = __decorate$1k([injectable(), __param$E(0, multiInject(GraphicRender)), __param$E(1, inject(ContributionProvider)), __param$E(1, named(DrawItemInterceptor)), __metadata$$("design:paramtypes", [Array, Object])], DefaultDrawContribution);
18273
-
18274
- var __decorate$1j = undefined && undefined.__decorate || function (decorators, target, key, desc) {
18275
- var d,
18276
- c = arguments.length,
18277
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
18278
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
18279
- return c > 3 && r && Object.defineProperty(target, key, r), r;
18280
- },
18281
- __metadata$_ = undefined && undefined.__metadata || function (k, v) {
18282
- if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
18283
- },
18284
- __param$D = undefined && undefined.__param || function (paramIndex, decorator) {
18285
- return function (target, key) {
18286
- decorator(target, key, paramIndex);
18287
- };
18288
- };
18289
- let DefaultCanvasGroupRender = class {
18290
- constructor(groupRenderContribitions) {
18291
- this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
18292
- }
18293
- drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
18294
- const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
18295
- {
18296
- fill = groupAttribute.fill,
18297
- background: background,
18298
- stroke = groupAttribute.stroke,
18299
- opacity = groupAttribute.opacity,
18300
- width = groupAttribute.width,
18301
- height = groupAttribute.height,
18302
- clip = groupAttribute.clip,
18303
- fillOpacity = groupAttribute.fillOpacity,
18304
- strokeOpacity = groupAttribute.strokeOpacity,
18305
- cornerRadius = groupAttribute.cornerRadius,
18306
- path = groupAttribute.path,
18307
- lineWidth = groupAttribute.lineWidth,
18308
- visible = groupAttribute.visible
18309
- } = group.attribute,
18310
- fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
18311
- sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
18312
- doFill = runFill(fill, background),
18313
- doStroke = runStroke(stroke, lineWidth);
18314
- if (!group.valid || !visible) return;
18315
- if (!clip) {
18316
- if (!doFill && !doStroke) return;
18317
- if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
18318
- }
18319
- if (path && path.length && drawContext.drawContribution) {
18320
- const disableFill = context.disableFill,
18321
- disableStroke = context.disableStroke,
18322
- disableBeginPath = context.disableBeginPath;
18323
- context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
18324
- drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
18325
- }), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
18326
- } else 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
18327
- this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
18328
- const doFillOrStroke = {
18329
- doFill: doFill,
18330
- doStroke: doStroke
18331
- };
18332
- this._groupRenderContribitions.forEach(c => {
18333
- c.time === exports.BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
18334
- }), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute), doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke())), this._groupRenderContribitions.forEach(c => {
18335
- c.time === exports.BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
18336
- });
18337
- }
18338
- draw(group, renderService, drawContext, params) {
18339
- const {
18340
- context: context
18341
- } = drawContext;
18342
- if (!context) return;
18343
- const {
18344
- clip: clip,
18345
- baseOpacity = 1
18346
- } = group.attribute;
18347
- clip ? context.save() : context.highPerformanceSave(), context.baseGlobalAlpha *= baseOpacity;
18348
- const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
18349
- lastModelMatrix = context.modelMatrix;
18350
- if (context.camera) {
18351
- const nextModelMatrix = mat4Allocate.allocate(),
18352
- modelMatrix = mat4Allocate.allocate();
18353
- getModelMatrix(modelMatrix, group, groupAttribute), multiplyMat4Mat4(nextModelMatrix, lastModelMatrix || nextModelMatrix, modelMatrix), context.modelMatrix = nextModelMatrix, mat4Allocate.free(modelMatrix), context.setTransform(1, 0, 0, 1, 0, 0, !0);
18354
- } else context.transformFromMatrix(group.transMatrix, !0);
18355
- context.beginPath(), params.skipDraw ? this.drawShape(group, context, 0, 0, drawContext, params, () => !1, () => !1) : this.drawShape(group, context, 0, 0, drawContext);
18356
- const {
18357
- scrollX = groupAttribute.scrollX,
18358
- scrollY = groupAttribute.scrollY
18359
- } = group.attribute;
18360
- let p;
18361
- (scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha /= baseOpacity, p && p.then ? p.then(() => {
18362
- clip ? context.restore() : context.highPerformanceRestore();
18363
- }) : clip ? context.restore() : context.highPerformanceRestore();
18364
- }
18365
- };
18366
- DefaultCanvasGroupRender = __decorate$1j([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(GroupRenderContribution)), __metadata$_("design:paramtypes", [Object])], DefaultCanvasGroupRender);
18383
+ DefaultDrawContribution = __decorate$1j([injectable(), __param$D(0, multiInject(GraphicRender)), __param$D(1, inject(ContributionProvider)), __param$D(1, named(DrawItemInterceptor)), __metadata$_("design:paramtypes", [Array, Object])], DefaultDrawContribution);
18367
18384
 
18368
18385
  var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
18369
18386
  var d,
@@ -18607,7 +18624,7 @@
18607
18624
  DefaultIncrementalDrawContribution = __decorate$1g([injectable(), __param$C(0, multiInject(GraphicRender)), __param$C(1, inject(DefaultIncrementalCanvasLineRender)), __param$C(2, inject(DefaultIncrementalCanvasAreaRender)), __param$C(3, inject(ContributionProvider)), __param$C(3, named(DrawItemInterceptor)), __metadata$Z("design:paramtypes", [Array, Object, Object, Object])], DefaultIncrementalDrawContribution);
18608
18625
 
18609
18626
  var renderModule = new ContainerModule(bind => {
18610
- bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(exports.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(exports.CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
18627
+ bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(exports.DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(exports.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(exports.CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
18611
18628
  });
18612
18629
 
18613
18630
  function load(container) {
@@ -18800,8 +18817,9 @@
18800
18817
  }
18801
18818
  const containerTL = application.global.getElementTopLeft(nativeContainer, !1),
18802
18819
  windowTL = stage.window.getTopLeft(!1),
18803
- offsetX = left + windowTL.left - containerTL.left,
18804
- offsetTop = top + windowTL.top - containerTL.top;
18820
+ viewBox = stage.viewBox,
18821
+ offsetX = left + windowTL.left - containerTL.left + viewBox.x1,
18822
+ offsetTop = top + windowTL.top - containerTL.top + viewBox.y1;
18805
18823
  if (calculateStyle.left = `${offsetX}px`, calculateStyle.top = `${offsetTop}px`, "text" === graphic.type && "position" === anchorType && (calculateStyle = Object.assign(Object.assign({}, calculateStyle), this.getTransformOfText(graphic))), isFunction$1(options.style)) {
18806
18824
  const userStyle = options.style({
18807
18825
  top: offsetTop,
@@ -29298,7 +29316,7 @@
29298
29316
 
29299
29317
  const roughModule = _roughModule;
29300
29318
 
29301
- const version = "0.19.21";
29319
+ const version = "0.19.23";
29302
29320
  preLoadAllModule();
29303
29321
  if (isBrowserEnv()) {
29304
29322
  loadBrowserEnv(container);