@visactor/vrender 0.17.0-alpha.5 → 0.17.0-alpha.6

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,3 +1,3 @@
1
- export declare const version = "0.17.0-alpha.5";
1
+ export declare const version = "0.17.0-alpha.6";
2
2
  export * from '@visactor/vrender-core';
3
3
  export * from '@visactor/vrender-kits';
package/cjs/index.js CHANGED
@@ -21,5 +21,5 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits");
23
23
 
24
- exports.version = "0.17.0-alpha.5", (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container),
24
+ exports.version = "0.17.0-alpha.6", (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container),
25
25
  __exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAwD;AAG3C,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;AAE1B,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadBrowserEnv } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.17.0-alpha.5\";\n\nloadBrowserEnv(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAwD;AAG3C,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;AAE1B,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadBrowserEnv } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.17.0-alpha.6\";\n\nloadBrowserEnv(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
package/dist/index.js CHANGED
@@ -5115,12 +5115,16 @@
5115
5115
  var DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
5116
5116
  width: 0,
5117
5117
  height: 0,
5118
+ x1: 0,
5119
+ y1: 0,
5118
5120
  strokeBoundsBuffer: 0,
5119
5121
  cornerRadius: 0
5120
5122
  });
5121
5123
  var DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
5122
5124
  width: 0,
5123
5125
  height: 0,
5126
+ x1: 0,
5127
+ y1: 0,
5124
5128
  cornerRadius: 0,
5125
5129
  length: 0
5126
5130
  });
@@ -12747,13 +12751,13 @@
12747
12751
  return fill && opacity * fillOpacity > 0;
12748
12752
  }
12749
12753
  function rectFillVisible(opacity, fillOpacity, width, height, fill) {
12750
- return fill && opacity * fillOpacity > 0 && width > 0 && height > 0;
12754
+ return fill && opacity * fillOpacity > 0 && 0 !== width && 0 !== height;
12751
12755
  }
12752
12756
  function strokeVisible(opacity, strokeOpacity) {
12753
12757
  return opacity * strokeOpacity > 0;
12754
12758
  }
12755
12759
  function rectStrokeVisible(opacity, strokeOpacity, width, height) {
12756
- return opacity * strokeOpacity > 0 && width > 0 && height > 0;
12760
+ return opacity * strokeOpacity > 0 && 0 !== width && 0 !== height;
12757
12761
  }
12758
12762
  function drawPathProxy(graphic, context, x, y, drawContext, params, fillCb, strokeCb) {
12759
12763
  if (!graphic.pathProxy) return !1;
@@ -14946,7 +14950,7 @@
14946
14950
  curveType: 1
14947
14951
  }, NOWORK_ANIMATE_ATTR);
14948
14952
 
14949
- var RECT_UPDATE_TAG_KEY = ["width", "height", "cornerRadius"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
14953
+ var RECT_UPDATE_TAG_KEY = ["width", "x1", "y1", "height", "cornerRadius"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
14950
14954
  var Rect = /*#__PURE__*/function (_Graphic) {
14951
14955
  _inherits(Rect, _Graphic);
14952
14956
  var _super = _createSuper(Rect);
@@ -14964,10 +14968,7 @@
14964
14968
  }, {
14965
14969
  key: "_isValid",
14966
14970
  value: function _isValid() {
14967
- var _this$attribute = this.attribute,
14968
- width = _this$attribute.width,
14969
- height = _this$attribute.height;
14970
- return this._validNumber(width) && this._validNumber(height);
14971
+ return !0;
14971
14972
  }
14972
14973
  }, {
14973
14974
  key: "doUpdateAABBBounds",
@@ -15004,11 +15005,7 @@
15004
15005
  }, {
15005
15006
  key: "toCustomPath",
15006
15007
  value: function toCustomPath() {
15007
- var attribute = this.attribute,
15008
- width = attribute.width,
15009
- height = attribute.height,
15010
- path = new CustomPath2D();
15011
- return path.moveTo(0, 0), path.rect(0, 0, width, height), path;
15008
+ throw new Error("暂不支持");
15012
15009
  }
15013
15010
  }, {
15014
15011
  key: "clone",
@@ -17096,11 +17093,13 @@
17096
17093
  key: "updateRectAABBBounds",
17097
17094
  value: function updateRectAABBBounds(attribute, rectTheme, aabbBounds, graphic) {
17098
17095
  if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
17099
- var _attribute$width = attribute.width,
17100
- width = _attribute$width === void 0 ? rectTheme.width : _attribute$width,
17101
- _attribute$height = attribute.height,
17102
- height = _attribute$height === void 0 ? rectTheme.height : _attribute$height;
17103
- aabbBounds.set(0, 0, width, height);
17096
+ var width = attribute.width,
17097
+ height = attribute.height;
17098
+ var x1 = attribute.x1,
17099
+ y1 = attribute.y1,
17100
+ x = attribute.x,
17101
+ y = attribute.y;
17102
+ width = null != width ? width : x1 - x, height = null != height ? height : y1 - y, aabbBounds.set(0, 0, width || 0, height || 0);
17104
17103
  }
17105
17104
  var tb1 = this.tempAABBBounds1,
17106
17105
  tb2 = this.tempAABBBounds2;
@@ -17136,10 +17135,10 @@
17136
17135
  key: "updateRichTextAABBBounds",
17137
17136
  value: function updateRichTextAABBBounds(attribute, richtextTheme, aabbBounds, graphic) {
17138
17137
  if (!graphic) return aabbBounds;
17139
- var _attribute$width2 = attribute.width,
17140
- width = _attribute$width2 === void 0 ? richtextTheme.width : _attribute$width2,
17141
- _attribute$height2 = attribute.height,
17142
- height = _attribute$height2 === void 0 ? richtextTheme.height : _attribute$height2,
17138
+ var _attribute$width = attribute.width,
17139
+ width = _attribute$width === void 0 ? richtextTheme.width : _attribute$width,
17140
+ _attribute$height = attribute.height,
17141
+ height = _attribute$height === void 0 ? richtextTheme.height : _attribute$height,
17143
17142
  _attribute$maxWidth = attribute.maxWidth,
17144
17143
  maxWidth = _attribute$maxWidth === void 0 ? richtextTheme.maxWidth : _attribute$maxWidth,
17145
17144
  _attribute$maxHeight = attribute.maxHeight,
@@ -17251,8 +17250,8 @@
17251
17250
  if (!stage || !stage.camera) return aabbBounds;
17252
17251
  var _attribute$outerRadiu = attribute.outerRadius,
17253
17252
  outerRadius = _attribute$outerRadiu === void 0 ? arcTheme.outerRadius : _attribute$outerRadiu,
17254
- _attribute$height3 = attribute.height,
17255
- height = _attribute$height3 === void 0 ? 0 : _attribute$height3,
17253
+ _attribute$height2 = attribute.height,
17254
+ height = _attribute$height2 === void 0 ? 0 : _attribute$height2,
17256
17255
  r = outerRadius + height;
17257
17256
  aabbBounds.setValue(-r, -r, r, r);
17258
17257
  var tb1 = this.tempAABBBounds1,
@@ -17452,10 +17451,10 @@
17452
17451
  key: "updateImageAABBBounds",
17453
17452
  value: function updateImageAABBBounds(attribute, imageTheme, aabbBounds, graphic) {
17454
17453
  if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
17455
- var _attribute$width3 = attribute.width,
17456
- width = _attribute$width3 === void 0 ? imageTheme.width : _attribute$width3,
17457
- _attribute$height4 = attribute.height,
17458
- height = _attribute$height4 === void 0 ? imageTheme.height : _attribute$height4;
17454
+ var _attribute$width2 = attribute.width,
17455
+ width = _attribute$width2 === void 0 ? imageTheme.width : _attribute$width2,
17456
+ _attribute$height3 = attribute.height,
17457
+ height = _attribute$height3 === void 0 ? imageTheme.height : _attribute$height3;
17459
17458
  aabbBounds.set(0, 0, width, height);
17460
17459
  }
17461
17460
  var tb1 = this.tempAABBBounds1,
@@ -18265,7 +18264,7 @@
18265
18264
  var halfPi = pi / 2;
18266
18265
  function createRectPath(path, x, y, width, height, rectCornerRadius) {
18267
18266
  var cornerRadius;
18268
- if (isNumber$2(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius, rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
18267
+ if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$2(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius, rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
18269
18268
  var cornerRadiusArr = rectCornerRadius;
18270
18269
  switch (cornerRadiusArr.length) {
18271
18270
  case 0:
@@ -18409,10 +18408,6 @@
18409
18408
  doInnerBorder = innerBorder && !1 !== innerBorder.visible;
18410
18409
  if (!doOuterBorder && !doInnerBorder) return;
18411
18410
  var _rect$attribute2 = rect.attribute,
18412
- _rect$attribute2$widt = _rect$attribute2.width,
18413
- width = _rect$attribute2$widt === void 0 ? rectAttribute.width : _rect$attribute2$widt,
18414
- _rect$attribute2$heig = _rect$attribute2.height,
18415
- height = _rect$attribute2$heig === void 0 ? rectAttribute.height : _rect$attribute2$heig,
18416
18411
  _rect$attribute2$corn = _rect$attribute2.cornerRadius,
18417
18412
  cornerRadius = _rect$attribute2$corn === void 0 ? rectAttribute.cornerRadius : _rect$attribute2$corn,
18418
18413
  _rect$attribute2$opac = _rect$attribute2.opacity,
@@ -18425,7 +18420,13 @@
18425
18420
  scaleX = _rect$attribute2$scal === void 0 ? rectAttribute.scaleX : _rect$attribute2$scal,
18426
18421
  _rect$attribute2$scal2 = _rect$attribute2.scaleY,
18427
18422
  scaleY = _rect$attribute2$scal2 === void 0 ? rectAttribute.scaleY : _rect$attribute2$scal2,
18428
- doStrokeOuter = !(!outerBorder || !outerBorder.stroke),
18423
+ x1 = _rect$attribute2.x1,
18424
+ y1 = _rect$attribute2.y1;
18425
+ var _rect$attribute3 = rect.attribute,
18426
+ width = _rect$attribute3.width,
18427
+ height = _rect$attribute3.height;
18428
+ width = (null != width ? width : x1 - x) || 0, height = (null != height ? height : y1 - y) || 0;
18429
+ var doStrokeOuter = !(!outerBorder || !outerBorder.stroke),
18429
18430
  doStrokeInner = !(!innerBorder || !innerBorder.stroke);
18430
18431
  if (doOuterBorder) {
18431
18432
  var _outerBorder$distance = outerBorder.distance,
@@ -18484,13 +18485,13 @@
18484
18485
  _createClass(SplitRectAfterRenderContribution, [{
18485
18486
  key: "drawShape",
18486
18487
  value: function drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
18487
- var _rect$attribute3 = rect.attribute,
18488
- _rect$attribute3$widt = _rect$attribute3.width,
18489
- width = _rect$attribute3$widt === void 0 ? groupAttribute.width : _rect$attribute3$widt,
18490
- _rect$attribute3$heig = _rect$attribute3.height,
18491
- height = _rect$attribute3$heig === void 0 ? groupAttribute.height : _rect$attribute3$heig,
18492
- _rect$attribute3$stro = _rect$attribute3.stroke,
18493
- stroke = _rect$attribute3$stro === void 0 ? groupAttribute.stroke : _rect$attribute3$stro;
18488
+ var _rect$attribute4 = rect.attribute,
18489
+ _rect$attribute4$widt = _rect$attribute4.width,
18490
+ width = _rect$attribute4$widt === void 0 ? groupAttribute.width : _rect$attribute4$widt,
18491
+ _rect$attribute4$heig = _rect$attribute4.height,
18492
+ height = _rect$attribute4$heig === void 0 ? groupAttribute.height : _rect$attribute4$heig,
18493
+ _rect$attribute4$stro = _rect$attribute4.stroke,
18494
+ stroke = _rect$attribute4$stro === void 0 ? groupAttribute.stroke : _rect$attribute4$stro;
18494
18495
  if (Array.isArray(stroke) && stroke.some(function (s) {
18495
18496
  return !1 === s;
18496
18497
  })) {
@@ -19708,10 +19709,6 @@
19708
19709
  background = _rect$attribute.background,
19709
19710
  _rect$attribute$strok = _rect$attribute.stroke,
19710
19711
  stroke = _rect$attribute$strok === void 0 ? rectAttribute.stroke : _rect$attribute$strok,
19711
- _rect$attribute$width = _rect$attribute.width,
19712
- width = _rect$attribute$width === void 0 ? rectAttribute.width : _rect$attribute$width,
19713
- _rect$attribute$heigh = _rect$attribute.height,
19714
- height = _rect$attribute$heigh === void 0 ? rectAttribute.height : _rect$attribute$heigh,
19715
19712
  _rect$attribute$corne = _rect$attribute.cornerRadius,
19716
19713
  cornerRadius = _rect$attribute$corne === void 0 ? rectAttribute.cornerRadius : _rect$attribute$corne,
19717
19714
  _rect$attribute$opaci = _rect$attribute.opacity,
@@ -19724,11 +19721,17 @@
19724
19721
  strokeOpacity = _rect$attribute$strok2 === void 0 ? rectAttribute.strokeOpacity : _rect$attribute$strok2,
19725
19722
  _rect$attribute$visib = _rect$attribute.visible,
19726
19723
  visible = _rect$attribute$visib === void 0 ? rectAttribute.visible : _rect$attribute$visib,
19724
+ x1 = _rect$attribute.x1,
19725
+ y1 = _rect$attribute.y1,
19727
19726
  _rect$attribute$x = _rect$attribute.x,
19728
19727
  originX = _rect$attribute$x === void 0 ? rectAttribute.x : _rect$attribute$x,
19729
19728
  _rect$attribute$y = _rect$attribute.y,
19730
- originY = _rect$attribute$y === void 0 ? rectAttribute.y : _rect$attribute$y,
19731
- fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
19729
+ originY = _rect$attribute$y === void 0 ? rectAttribute.y : _rect$attribute$y;
19730
+ var _rect$attribute2 = rect.attribute,
19731
+ width = _rect$attribute2.width,
19732
+ height = _rect$attribute2.height;
19733
+ width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
19734
+ var fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
19732
19735
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
19733
19736
  doFill = runFill(fill, background),
19734
19737
  doStroke = runStroke(stroke, lineWidth);
@@ -23318,7 +23321,7 @@
23318
23321
  canvasControled: !1 !== params.canvasControled,
23319
23322
  title: params.title || "",
23320
23323
  canvas: params.canvas
23321
- }), _this._viewBox = new AABBBounds(), params.viewBox ? _this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : _this._viewBox.setValue(0, 0, _this.width, _this.height), _this.state = "normal", _this.renderCount = 0, _this._subView = !(_this._viewBox.width() === _this.width && _this._viewBox.height() === _this.height), _this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, _this.appendChild(_this.layerService.createLayer(_assertThisInitialized(_this), {
23324
+ }), _this._viewBox = new AABBBounds(), params.viewBox ? _this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : _this._viewBox.setValue(0, 0, _this.width, _this.height), _this.state = "normal", _this.renderCount = 0, _this.tryInitEventSystem(), _this._subView = !(_this._viewBox.width() === _this.width && _this._viewBox.height() === _this.height), _this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, _this.appendChild(_this.layerService.createLayer(_assertThisInitialized(_this), {
23322
23325
  main: !0
23323
23326
  })), _this.nextFrameRenderLayerSet = new Set(), _this.willNextFrameRender = !1, _this.stage = _assertThisInitialized(_this), _this.renderStyle = params.renderStyle, params.autoRender && _this.enableAutoRender(), !1 === params.disableDirtyBounds && _this.enableDirtyBounds(), params.enableHtmlAttribute && _this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && _this.enableLayout(), _this.hooks.beforeRender.tap("constructor", _this.beforeRender), _this.hooks.afterRender.tap("constructor", _this.afterRender), _this._beforeRender = params.beforeRender, _this._afterRender = params.afterRender, _this.ticker = params.ticker || defaultTicker, _this.supportInteractiveLayer = !1 !== params.interactiveLayer, _this.timeline = new DefaultTimeline(), _this.ticker.addTimeline(_this.timeline), _this.timeline.pause(), params.optimize || (params.optimize = {}), _this.optmize(params.optimize), params.background && isString$1(_this._background) && _this._background.includes("/") && _this.setAttributes({
23324
23327
  background: _this._background
@@ -23406,7 +23409,7 @@
23406
23409
  }, {
23407
23410
  key: "eventSystem",
23408
23411
  get: function get() {
23409
- return this.tryInitEventSystem(), this._eventSystem;
23412
+ return this._eventSystem;
23410
23413
  }
23411
23414
  }, {
23412
23415
  key: "tryInitEventSystem",
@@ -27487,10 +27490,8 @@
27487
27490
  fillColor = _rect$attribute3$fill2 === void 0 ? rectAttribute.fill : _rect$attribute3$fill2,
27488
27491
  _rect$attribute3$stro2 = _rect$attribute3.strokeColor,
27489
27492
  strokeColor = _rect$attribute3$stro2 === void 0 ? rectAttribute.stroke : _rect$attribute3$stro2,
27490
- _rect$attribute3$widt = _rect$attribute3.width,
27491
- width = _rect$attribute3$widt === void 0 ? rectAttribute.width : _rect$attribute3$widt,
27492
- _rect$attribute3$heig = _rect$attribute3.height,
27493
- height = _rect$attribute3$heig === void 0 ? rectAttribute.height : _rect$attribute3$heig,
27493
+ x1 = _rect$attribute3.x1,
27494
+ y1 = _rect$attribute3.y1,
27494
27495
  _rect$attribute3$line = _rect$attribute3.lineWidth,
27495
27496
  lineWidth = _rect$attribute3$line === void 0 ? rectAttribute.lineWidth : _rect$attribute3$line,
27496
27497
  _rect$attribute3$maxR = _rect$attribute3.maxRandomnessOffset,
@@ -27535,7 +27536,12 @@
27535
27536
  preserveVertices = _rect$attribute3$pres === void 0 ? defaultRouthThemeSpec.preserveVertices : _rect$attribute3$pres,
27536
27537
  _rect$attribute3$fixe = _rect$attribute3.fixedDecimalPlaceDigits,
27537
27538
  fixedDecimalPlaceDigits = _rect$attribute3$fixe === void 0 ? defaultRouthThemeSpec.fixedDecimalPlaceDigits : _rect$attribute3$fixe;
27538
- rc.rectangle(x, y, width, height, {
27539
+ var _rect$attribute4 = rect.attribute,
27540
+ _rect$attribute4$widt = _rect$attribute4.width,
27541
+ width = _rect$attribute4$widt === void 0 ? rectAttribute.width : _rect$attribute4$widt,
27542
+ _rect$attribute4$heig = _rect$attribute4.height,
27543
+ height = _rect$attribute4$heig === void 0 ? rectAttribute.height : _rect$attribute4$heig;
27544
+ width = (null != width ? width : x1 - x) || 0, height = (null != height ? height : y1 - y) || 0, rc.rectangle(x, y, width, height, {
27539
27545
  fill: fill ? fillColor : void 0,
27540
27546
  stroke: stroke ? strokeColor : void 0,
27541
27547
  strokeWidth: lineWidth,
@@ -33415,7 +33421,7 @@
33415
33421
 
33416
33422
  var roughModule = _roughModule;
33417
33423
 
33418
- const version = "0.17.0-alpha.5";
33424
+ const version = "0.17.0-alpha.6";
33419
33425
  loadBrowserEnv(container);
33420
33426
 
33421
33427
  exports.ACustomAnimate = ACustomAnimate;