@visactor/vrender 0.17.18-alpha.1 → 0.17.19-alpha.1

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/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "0.17.18-alpha.1";
2
+ export declare const version = "0.17.19-alpha.1";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
package/cjs/index.js CHANGED
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
23
23
 
24
- exports.version = "0.17.18-alpha.1", (0, vrender_core_1.preLoadAllModule)(), (0,
24
+ exports.version = "0.17.19-alpha.1", (0, vrender_core_1.preLoadAllModule)(), (0,
25
25
  vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
26
26
  vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
27
27
  (0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.17.18-alpha.1\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.17.19-alpha.1\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
package/dist/index.js CHANGED
@@ -5158,6 +5158,7 @@
5158
5158
  var DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
5159
5159
  opacity: 1,
5160
5160
  background: null,
5161
+ backgroundCornerRadius: 0,
5161
5162
  texture: null,
5162
5163
  textureColor: "black",
5163
5164
  textureSize: 10,
@@ -12818,7 +12819,7 @@
12818
12819
  value: function doUpdateAABBBounds() {
12819
12820
  var attribute = this.attribute,
12820
12821
  groupTheme = getTheme(this).group;
12821
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
12822
+ this._AABBBounds.clear();
12822
12823
  var bounds = application.graphicService.updateGroupAABBBounds(attribute, groupTheme, this._AABBBounds, this),
12823
12824
  _attribute$boundsPadd = attribute.boundsPadding,
12824
12825
  boundsPadding = _attribute$boundsPadd === void 0 ? groupTheme.boundsPadding : _attribute$boundsPadd,
@@ -13639,7 +13640,7 @@
13639
13640
  key: "doUpdateAABBBounds",
13640
13641
  value: function doUpdateAABBBounds(full) {
13641
13642
  var circleTheme = getTheme(this).circle;
13642
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
13643
+ this._AABBBounds.clear();
13643
13644
  var attribute = this.attribute,
13644
13645
  bounds = application.graphicService.updateCircleAABBBounds(attribute, getTheme(this).circle, this._AABBBounds, full, this),
13645
13646
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -13826,7 +13827,7 @@
13826
13827
  return CanvasTextLayout;
13827
13828
  }();
13828
13829
 
13829
- var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
13830
+ var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
13830
13831
  var Text = /*#__PURE__*/function (_Graphic) {
13831
13832
  _inherits(Text, _Graphic);
13832
13833
  var _super = _createSuper(Text);
@@ -13906,7 +13907,7 @@
13906
13907
  key: "doUpdateAABBBounds",
13907
13908
  value: function doUpdateAABBBounds() {
13908
13909
  var textTheme = getTheme(this).text;
13909
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
13910
+ this._AABBBounds.clear();
13910
13911
  var attribute = this.attribute,
13911
13912
  bounds = application.graphicService.updateTextAABBBounds(attribute, textTheme, this._AABBBounds, this),
13912
13913
  _this$attribute$bound = this.attribute.boundsPadding,
@@ -15385,7 +15386,7 @@
15385
15386
  key: "doUpdateAABBBounds",
15386
15387
  value: function doUpdateAABBBounds(full) {
15387
15388
  var symbolTheme = getTheme(this).symbol;
15388
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15389
+ this._AABBBounds.clear();
15389
15390
  var attribute = this.attribute,
15390
15391
  bounds = application.graphicService.updateSymbolAABBBounds(attribute, getTheme(this).symbol, this._AABBBounds, full, this),
15391
15392
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -15475,7 +15476,7 @@
15475
15476
  key: "doUpdateAABBBounds",
15476
15477
  value: function doUpdateAABBBounds() {
15477
15478
  var lineTheme = getTheme(this).line;
15478
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15479
+ this._AABBBounds.clear();
15479
15480
  var attribute = this.attribute,
15480
15481
  bounds = application.graphicService.updateLineAABBBounds(attribute, getTheme(this).line, this._AABBBounds, this),
15481
15482
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -15566,7 +15567,7 @@
15566
15567
  key: "doUpdateAABBBounds",
15567
15568
  value: function doUpdateAABBBounds() {
15568
15569
  var rectTheme = getTheme(this).rect;
15569
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15570
+ this._AABBBounds.clear();
15570
15571
  var attribute = this.attribute,
15571
15572
  bounds = application.graphicService.updateRectAABBBounds(attribute, getTheme(this).rect, this._AABBBounds, this),
15572
15573
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -15796,7 +15797,7 @@
15796
15797
  }, {
15797
15798
  key: "doUpdateAABBBounds",
15798
15799
  value: function doUpdateAABBBounds() {
15799
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15800
+ this._AABBBounds.clear();
15800
15801
  var bounds = application.graphicService.updateGlyphAABBBounds(this.attribute, getTheme(this).glyph, this._AABBBounds, this);
15801
15802
  return this.clearUpdateBoundTag(), bounds;
15802
15803
  }
@@ -16182,7 +16183,7 @@
16182
16183
  key: "doUpdateAABBBounds",
16183
16184
  value: function doUpdateAABBBounds() {
16184
16185
  var imageTheme = getTheme(this).image;
16185
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16186
+ this._AABBBounds.clear();
16186
16187
  var attribute = this.attribute,
16187
16188
  bounds = application.graphicService.updateImageAABBBounds(attribute, getTheme(this).image, this._AABBBounds, this),
16188
16189
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -16541,7 +16542,7 @@
16541
16542
  key: "doUpdateAABBBounds",
16542
16543
  value: function doUpdateAABBBounds() {
16543
16544
  var richTextTheme = getTheme(this).richtext;
16544
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16545
+ this._AABBBounds.clear();
16545
16546
  var attribute = this.attribute,
16546
16547
  bounds = application.graphicService.updateRichTextAABBBounds(attribute, getTheme(this).richtext, this._AABBBounds, this),
16547
16548
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -16604,10 +16605,13 @@
16604
16605
  _this2.addUpdateBoundTag(), null === (_a = _this2.stage) || void 0 === _a || _a.renderNextFrame();
16605
16606
  }, icon.richtextId = config.id, paragraphs.push(icon);
16606
16607
  }
16607
- } else if (textConfig[i].text.includes("\n")) {
16608
- var textParts = textConfig[i].text.split("\n");
16609
- for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, textConfig[i]));
16610
- } else paragraphs.push(new Paragraph(textConfig[i].text, !1, textConfig[i]));
16608
+ } else {
16609
+ var richTextConfig = textConfig[i];
16610
+ if (isNumber$2(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text.includes("\n")) {
16611
+ var textParts = richTextConfig.text.split("\n");
16612
+ for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
16613
+ } else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
16614
+ }
16611
16615
  var maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
16612
16616
  maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
16613
16617
  richTextWidthEnable = "number" == typeof width && Number.isFinite(width) && width > 0 && (!maxWidthFinite || width <= maxWidth),
@@ -16726,7 +16730,7 @@
16726
16730
  key: "doUpdateAABBBounds",
16727
16731
  value: function doUpdateAABBBounds() {
16728
16732
  var pathTheme = getTheme(this).path;
16729
- this.doUpdatePathShape(), this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16733
+ this.doUpdatePathShape(), this._AABBBounds.clear();
16730
16734
  var attribute = this.attribute,
16731
16735
  bounds = application.graphicService.updatePathAABBBounds(attribute, getTheme(this).path, this._AABBBounds, this),
16732
16736
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -16814,7 +16818,7 @@
16814
16818
  key: "doUpdateAABBBounds",
16815
16819
  value: function doUpdateAABBBounds() {
16816
16820
  var areaTheme = getTheme(this).area;
16817
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16821
+ this._AABBBounds.clear();
16818
16822
  var attribute = this.attribute,
16819
16823
  bounds = application.graphicService.updateAreaAABBBounds(attribute, getTheme(this).area, this._AABBBounds, this),
16820
16824
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17017,7 +17021,7 @@
17017
17021
  key: "doUpdateAABBBounds",
17018
17022
  value: function doUpdateAABBBounds(full) {
17019
17023
  var arcTheme = getTheme(this).arc;
17020
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17024
+ this._AABBBounds.clear();
17021
17025
  var attribute = this.attribute,
17022
17026
  bounds = application.graphicService.updateArcAABBBounds(attribute, getTheme(this).arc, this._AABBBounds, full, this),
17023
17027
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17103,7 +17107,7 @@
17103
17107
  key: "doUpdateAABBBounds",
17104
17108
  value: function doUpdateAABBBounds() {
17105
17109
  var polygonTheme = getTheme(this).arc;
17106
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17110
+ this._AABBBounds.clear();
17107
17111
  var attribute = this.attribute,
17108
17112
  bounds = application.graphicService.updateArc3dAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
17109
17113
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17151,7 +17155,7 @@
17151
17155
  key: "doUpdateAABBBounds",
17152
17156
  value: function doUpdateAABBBounds() {
17153
17157
  var polygonTheme = getTheme(this).polygon;
17154
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17158
+ this._AABBBounds.clear();
17155
17159
  var attribute = this.attribute,
17156
17160
  bounds = application.graphicService.updatePolygonAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
17157
17161
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17224,7 +17228,7 @@
17224
17228
  key: "doUpdateAABBBounds",
17225
17229
  value: function doUpdateAABBBounds() {
17226
17230
  var polygonTheme = getTheme(this).polygon;
17227
- this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17231
+ this._AABBBounds.clear();
17228
17232
  var attribute = this.attribute,
17229
17233
  bounds = application.graphicService.updatePyramid3dAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
17230
17234
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -18184,35 +18188,37 @@
18184
18188
  }, {
18185
18189
  key: "transformAABBBounds",
18186
18190
  value: function transformAABBBounds(attribute, aabbBounds, theme, miter, graphic) {
18187
- var _attribute$scaleX2 = attribute.scaleX,
18188
- scaleX = _attribute$scaleX2 === void 0 ? theme.scaleX : _attribute$scaleX2,
18189
- _attribute$scaleY2 = attribute.scaleY,
18190
- scaleY = _attribute$scaleY2 === void 0 ? theme.scaleY : _attribute$scaleY2,
18191
- _attribute$stroke = attribute.stroke,
18192
- stroke = _attribute$stroke === void 0 ? theme.stroke : _attribute$stroke,
18193
- _attribute$shadowBlur2 = attribute.shadowBlur,
18194
- shadowBlur = _attribute$shadowBlur2 === void 0 ? theme.shadowBlur : _attribute$shadowBlur2,
18195
- _attribute$lineWidth = attribute.lineWidth,
18196
- lineWidth = _attribute$lineWidth === void 0 ? theme.lineWidth : _attribute$lineWidth,
18197
- _attribute$pickStroke = attribute.pickStrokeBuffer,
18198
- pickStrokeBuffer = _attribute$pickStroke === void 0 ? theme.pickStrokeBuffer : _attribute$pickStroke,
18199
- _attribute$strokeBoun2 = attribute.strokeBoundsBuffer,
18200
- strokeBoundsBuffer = _attribute$strokeBoun2 === void 0 ? theme.strokeBoundsBuffer : _attribute$strokeBoun2,
18201
- tb1 = this.tempAABBBounds1,
18202
- tb2 = this.tempAABBBounds2;
18203
- if (stroke && lineWidth) {
18204
- var scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);
18205
- boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
18191
+ if (!aabbBounds.empty()) {
18192
+ var _attribute$scaleX2 = attribute.scaleX,
18193
+ scaleX = _attribute$scaleX2 === void 0 ? theme.scaleX : _attribute$scaleX2,
18194
+ _attribute$scaleY2 = attribute.scaleY,
18195
+ scaleY = _attribute$scaleY2 === void 0 ? theme.scaleY : _attribute$scaleY2,
18196
+ _attribute$stroke = attribute.stroke,
18197
+ stroke = _attribute$stroke === void 0 ? theme.stroke : _attribute$stroke,
18198
+ _attribute$shadowBlur2 = attribute.shadowBlur,
18199
+ shadowBlur = _attribute$shadowBlur2 === void 0 ? theme.shadowBlur : _attribute$shadowBlur2,
18200
+ _attribute$lineWidth = attribute.lineWidth,
18201
+ lineWidth = _attribute$lineWidth === void 0 ? theme.lineWidth : _attribute$lineWidth,
18202
+ _attribute$pickStroke = attribute.pickStrokeBuffer,
18203
+ pickStrokeBuffer = _attribute$pickStroke === void 0 ? theme.pickStrokeBuffer : _attribute$pickStroke,
18204
+ _attribute$strokeBoun2 = attribute.strokeBoundsBuffer,
18205
+ strokeBoundsBuffer = _attribute$strokeBoun2 === void 0 ? theme.strokeBoundsBuffer : _attribute$strokeBoun2,
18206
+ tb1 = this.tempAABBBounds1,
18207
+ tb2 = this.tempAABBBounds2;
18208
+ if (stroke && lineWidth) {
18209
+ var scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);
18210
+ boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
18211
+ }
18212
+ if (shadowBlur) {
18213
+ var _attribute$shadowOffs = attribute.shadowOffsetX,
18214
+ shadowOffsetX = _attribute$shadowOffs === void 0 ? theme.shadowOffsetX : _attribute$shadowOffs,
18215
+ _attribute$shadowOffs2 = attribute.shadowOffsetY,
18216
+ shadowOffsetY = _attribute$shadowOffs2 === void 0 ? theme.shadowOffsetY : _attribute$shadowOffs2,
18217
+ shadowBlurWidth = shadowBlur / Math.abs(scaleX + scaleY) * 2;
18218
+ boundStroke(tb1, shadowBlurWidth, !1, strokeBoundsBuffer + 1), tb1.translate(shadowOffsetX, shadowOffsetY), aabbBounds.union(tb1);
18219
+ }
18206
18220
  }
18207
- if (shadowBlur) {
18208
- var _attribute$shadowOffs = attribute.shadowOffsetX,
18209
- shadowOffsetX = _attribute$shadowOffs === void 0 ? theme.shadowOffsetX : _attribute$shadowOffs,
18210
- _attribute$shadowOffs2 = attribute.shadowOffsetY,
18211
- shadowOffsetY = _attribute$shadowOffs2 === void 0 ? theme.shadowOffsetY : _attribute$shadowOffs2,
18212
- shadowBlurWidth = shadowBlur / Math.abs(scaleX + scaleY) * 2;
18213
- boundStroke(tb1, shadowBlurWidth, !1, strokeBoundsBuffer + 1), tb1.translate(shadowOffsetX, shadowOffsetY), aabbBounds.union(tb1);
18214
- }
18215
- this.combindShadowAABBBounds(aabbBounds, graphic);
18221
+ if (this.combindShadowAABBBounds(aabbBounds, graphic), aabbBounds.empty()) return;
18216
18222
  var updateMatrix = !0;
18217
18223
  var m = graphic.transMatrix;
18218
18224
  graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);
@@ -20808,7 +20814,10 @@
20808
20814
  var res = graphic.resources.get(background);
20809
20815
  if ("success" !== res.state || !res.data) return;
20810
20816
  context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
20811
- } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
20817
+ } else {
20818
+ var backgroundCornerRadius = graphic.attribute.backgroundCornerRadius;
20819
+ context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
20820
+ }
20812
20821
  shouldReCalBounds && boundsAllocate.free(b);
20813
20822
  }
20814
20823
  }]);
@@ -22273,7 +22282,7 @@
22273
22282
  var d = context.dpr % 1;
22274
22283
  (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
22275
22284
  var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
22276
- context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22285
+ context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.clear(), this.backupDirtyBounds.clear()), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22277
22286
  var _a, _b;
22278
22287
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22279
22288
  }).forEach(function (group) {
@@ -22336,7 +22345,7 @@
22336
22345
  }, subLayers.set(group._uid, incrementalLayer));
22337
22346
  var incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
22338
22347
  idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
22339
- idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22348
+ idc.dirtyBounds.clear(), idc.backupDirtyBounds.clear(), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22340
22349
  drawContribution: idc,
22341
22350
  clear: "transparent",
22342
22351
  layer: incrementalLayer.layer,
@@ -31129,6 +31138,105 @@
31129
31138
  c.load(mathModule), c.load(mathPickerModule);
31130
31139
  }
31131
31140
 
31141
+ var CanvasWrapDisableWH = /*#__PURE__*/function () {
31142
+ function CanvasWrapDisableWH(nativeCanvas, ctx, dpr, w, h, id) {
31143
+ _classCallCheck(this, CanvasWrapDisableWH);
31144
+ this.nativeCanvas = nativeCanvas, this.ctx = ctx, this._w = w, this._h = h, this.id = id, nativeCanvas.id = id, this.dpr = dpr;
31145
+ }
31146
+ _createClass(CanvasWrapDisableWH, [{
31147
+ key: "width",
31148
+ get: function get() {
31149
+ return this._w * this.dpr;
31150
+ },
31151
+ set: function set(w) {}
31152
+ }, {
31153
+ key: "height",
31154
+ get: function get() {
31155
+ return this._h * this.dpr;
31156
+ },
31157
+ set: function set(h) {}
31158
+ }, {
31159
+ key: "offsetWidth",
31160
+ get: function get() {
31161
+ return this._w;
31162
+ },
31163
+ set: function set(w) {}
31164
+ }, {
31165
+ key: "offsetHeight",
31166
+ get: function get() {
31167
+ return this._h;
31168
+ },
31169
+ set: function set(h) {}
31170
+ }, {
31171
+ key: "getContext",
31172
+ value: function getContext() {
31173
+ return this.ctx;
31174
+ }
31175
+ }, {
31176
+ key: "getBoundingClientRect",
31177
+ value: function getBoundingClientRect() {
31178
+ return {
31179
+ width: this._w,
31180
+ height: this._h
31181
+ };
31182
+ }
31183
+ }]);
31184
+ return CanvasWrapDisableWH;
31185
+ }();
31186
+ var CanvasWrapEnableWH = /*#__PURE__*/function () {
31187
+ function CanvasWrapEnableWH(nativeCanvas, ctx, dpr, w, h, id) {
31188
+ _classCallCheck(this, CanvasWrapEnableWH);
31189
+ this.nativeCanvas = nativeCanvas, this.ctx = ctx, this._w = w, this._h = h, this.id = id, nativeCanvas.id = id, this.dpr = dpr;
31190
+ }
31191
+ _createClass(CanvasWrapEnableWH, [{
31192
+ key: "width",
31193
+ get: function get() {
31194
+ return this._w * this.dpr;
31195
+ },
31196
+ set: function set(w) {
31197
+ this._w = w / this.dpr, this.nativeCanvas.width = w;
31198
+ }
31199
+ }, {
31200
+ key: "height",
31201
+ get: function get() {
31202
+ return this._h * this.dpr;
31203
+ },
31204
+ set: function set(h) {
31205
+ this._h = h / this.dpr, this.nativeCanvas.height = h;
31206
+ }
31207
+ }, {
31208
+ key: "offsetWidth",
31209
+ get: function get() {
31210
+ return this._w;
31211
+ },
31212
+ set: function set(w) {
31213
+ this._w = w, this.nativeCanvas.width = w * this.dpr;
31214
+ }
31215
+ }, {
31216
+ key: "offsetHeight",
31217
+ get: function get() {
31218
+ return this._h;
31219
+ },
31220
+ set: function set(h) {
31221
+ this._h = h, this.nativeCanvas.height = h * this.dpr;
31222
+ }
31223
+ }, {
31224
+ key: "getContext",
31225
+ value: function getContext() {
31226
+ return this.ctx;
31227
+ }
31228
+ }, {
31229
+ key: "getBoundingClientRect",
31230
+ value: function getBoundingClientRect() {
31231
+ return {
31232
+ width: this._w,
31233
+ height: this._h
31234
+ };
31235
+ }
31236
+ }]);
31237
+ return CanvasWrapEnableWH;
31238
+ }();
31239
+
31132
31240
  var __decorate$H = undefined && undefined.__decorate || function (decorators, target, key, desc) {
31133
31241
  var d,
31134
31242
  c = arguments.length,
@@ -31139,31 +31247,12 @@
31139
31247
  __metadata$z = undefined && undefined.__metadata || function (k, v) {
31140
31248
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
31141
31249
  };
31142
- function makeUpCanvas$3(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
31143
- var dpr = tt.getSystemInfoSync().pixelRatio;
31250
+ function makeUpCanvas$3(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
31251
+ var dpr = null != pixelRatio ? pixelRatio : tt.getSystemInfoSync().pixelRatio;
31144
31252
  canvasIdLists.forEach(function (id, i) {
31145
- var ctx = tt.createCanvasContext(id);
31146
- ctx.canvas = {
31147
- width: domref.width * dpr,
31148
- height: domref.height * dpr
31149
- };
31150
- var canvas = {
31151
- width: domref.width * dpr,
31152
- height: domref.height * dpr,
31153
- offsetWidth: domref.width,
31154
- offsetHeight: domref.height,
31155
- id: null != id ? id : "",
31156
- getContext: function getContext() {
31157
- return ctx;
31158
- },
31159
- getBoundingClientRect: function getBoundingClientRect() {
31160
- return {
31161
- height: domref.height,
31162
- width: domref.width
31163
- };
31164
- }
31165
- };
31166
- canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
31253
+ var ctx = tt.createCanvasContext(id),
31254
+ canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
31255
+ ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
31167
31256
  });
31168
31257
  }
31169
31258
  var FeishuEnvContribution = /*#__PURE__*/function (_BaseEnvContribution) {
@@ -31194,7 +31283,7 @@
31194
31283
  }, {
31195
31284
  key: "configure",
31196
31285
  value: function configure(service, params) {
31197
- service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$3(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList));
31286
+ service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$3(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.pixelRatio));
31198
31287
  }
31199
31288
  }, {
31200
31289
  key: "loadImage",
@@ -31372,11 +31461,11 @@
31372
31461
  value: function draw() {
31373
31462
  var _this = this;
31374
31463
  var _context = this.nativeContext;
31375
- this.drawPromise = new Promise(function (resolve) {
31464
+ _context.draw && (this.drawPromise = new Promise(function (resolve) {
31376
31465
  _context.draw(!0, function () {
31377
31466
  _this.drawPromise = null, resolve(null);
31378
31467
  });
31379
- });
31468
+ }));
31380
31469
  }
31381
31470
  }]);
31382
31471
  return LynxContext2d;
@@ -31645,32 +31734,13 @@
31645
31734
  try {
31646
31735
  ng = !!lynx.createCanvasNG;
31647
31736
  } catch (err) {}
31648
- function makeUpCanvas$2(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
31649
- var dpr = SystemInfo.pixelRatio;
31737
+ function makeUpCanvas$2(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
31738
+ var dpr = null != pixelRatio ? pixelRatio : SystemInfo.pixelRatio;
31650
31739
  canvasIdLists.forEach(function (id, i) {
31651
31740
  var _canvas = ng ? lynx.createCanvasNG(id) : lynx.createCanvas(id);
31652
31741
  _canvas.width = domref.width * dpr, _canvas.height = domref.height * dpr, ng && _canvas.attachToCanvasView(id);
31653
- var ctx = _canvas.getContext("2d");
31654
- ctx.draw = function (a, b) {
31655
- b();
31656
- };
31657
- var canvas = {
31658
- width: domref.width * dpr,
31659
- height: domref.height * dpr,
31660
- offsetWidth: domref.width,
31661
- offsetHeight: domref.height,
31662
- id: null != id ? id : "",
31663
- getContext: function getContext() {
31664
- return ctx;
31665
- },
31666
- getBoundingClientRect: function getBoundingClientRect() {
31667
- return {
31668
- height: domref.height,
31669
- width: domref.width
31670
- };
31671
- },
31672
- nativeCanvas: _canvas
31673
- };
31742
+ var ctx = _canvas.getContext("2d"),
31743
+ canvas = new CanvasWrapEnableWH(_canvas, ctx, dpr, domref.width, domref.height, id);
31674
31744
  canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
31675
31745
  });
31676
31746
  }
@@ -31704,7 +31774,7 @@
31704
31774
  _createClass(LynxEnvContribution, [{
31705
31775
  key: "configure",
31706
31776
  value: function configure(service, params) {
31707
- service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$2(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList));
31777
+ service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$2(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.pixelRatio));
31708
31778
  }
31709
31779
  }, {
31710
31780
  key: "getDynamicCanvasCount",
@@ -32296,6 +32366,34 @@
32296
32366
  value: function createPattern(image, repetition) {
32297
32367
  return null;
32298
32368
  }
32369
+ }, {
32370
+ key: "getImageData",
32371
+ value: function getImageData(sx, sy, sw, sh) {
32372
+ var _this = this;
32373
+ var ctx = this.nativeContext,
32374
+ taro = ctx.taro;
32375
+ if (ctx && taro) return !ctx.getImageData && taro.canvasGetImageData ? new Promise(function (resolve, reject) {
32376
+ try {
32377
+ taro.canvasGetImageData({
32378
+ canvasId: _this.canvas.nativeCanvas.id,
32379
+ sx: sx,
32380
+ sy: sy,
32381
+ sw: sw,
32382
+ sh: sh,
32383
+ success: function success(res) {
32384
+ resolve(res);
32385
+ }
32386
+ });
32387
+ } catch (err) {
32388
+ reject(err);
32389
+ }
32390
+ }) : void 0;
32391
+ }
32392
+ }, {
32393
+ key: "createRadialGradient",
32394
+ value: function createRadialGradient(x0, y0, r0, x1, y1, r1) {
32395
+ return this.nativeContext.createCircularGradient && this.nativeContext.createCircularGradient(x0, y0, r0, x1, y1, r1);
32396
+ }
32299
32397
  }]);
32300
32398
  return TaroContext2d;
32301
32399
  }(BrowserContext2d);
@@ -32563,47 +32661,9 @@
32563
32661
  };
32564
32662
  function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, taro, dpr) {
32565
32663
  canvasIdLists.forEach(function (id, i) {
32566
- var ctx = taro.createCanvasContext(id);
32567
- ctx.canvas = {
32568
- width: domref.width * dpr,
32569
- height: domref.height * dpr
32570
- }, ctx.createRadialGradient || (ctx.createRadialGradient = function () {
32571
- return ctx.createCircularGradient.apply(ctx, arguments);
32572
- }), !ctx.getImageData && taro.canvasGetImageData && (ctx.getImageData = function (x, y, width, height) {
32573
- return new Promise(function (resolve, reject) {
32574
- try {
32575
- taro.canvasGetImageData({
32576
- canvasId: id,
32577
- x: x,
32578
- y: y,
32579
- width: width,
32580
- height: height,
32581
- success: function success(res) {
32582
- resolve(res);
32583
- }
32584
- });
32585
- } catch (err) {
32586
- reject(err);
32587
- }
32588
- });
32589
- });
32590
- var canvas = {
32591
- id: id,
32592
- width: domref.width * dpr,
32593
- height: domref.height * dpr,
32594
- offsetWidth: domref.width,
32595
- offsetHeight: domref.height,
32596
- getContext: function getContext() {
32597
- return ctx;
32598
- },
32599
- getBoundingClientRect: function getBoundingClientRect() {
32600
- return {
32601
- height: domref.height,
32602
- width: domref.width
32603
- };
32604
- }
32605
- };
32606
- return canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), canvas;
32664
+ var ctx = taro.createCanvasContext(id),
32665
+ canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
32666
+ return ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), canvas;
32607
32667
  });
32608
32668
  }
32609
32669
  var TaroEnvContribution = /*#__PURE__*/function (_BaseEnvContribution) {
@@ -34848,7 +34908,7 @@
34848
34908
 
34849
34909
  var roughModule = _roughModule;
34850
34910
 
34851
- const version = "0.17.18-alpha.1";
34911
+ const version = "0.17.19-alpha.1";
34852
34912
  preLoadAllModule();
34853
34913
  if (isBrowserEnv()) {
34854
34914
  loadBrowserEnv(container);