@visactor/vrender-components 0.16.14-alpha.1 → 0.16.14-alpha.3

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
@@ -5348,6 +5348,137 @@
5348
5348
  return containPath(commands, lineWidth, !0, x, y);
5349
5349
  }
5350
5350
 
5351
+ var Edge;
5352
+ !function (Edge) {
5353
+ Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
5354
+ }(Edge || (Edge = {}));
5355
+ var _strokeVec4 = [!1, !1, !1, !1];
5356
+ var parseStroke = function parseStroke(stroke) {
5357
+ var _a;
5358
+ var isFullStroke = !0;
5359
+ if (vutils.isBoolean(stroke, !0)) {
5360
+ for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
5361
+ isFullStroke = stroke;
5362
+ } else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
5363
+ return {
5364
+ isFullStroke: isFullStroke,
5365
+ stroke: _strokeVec4
5366
+ };
5367
+ };
5368
+ var _paddingVec4 = [0, 0, 0, 0];
5369
+ var parsePadding = function parsePadding(padding) {
5370
+ return padding ? vutils.isArray(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
5371
+ };
5372
+ var _coords = [{
5373
+ x: 0,
5374
+ y: 0
5375
+ }, {
5376
+ x: 0,
5377
+ y: 0
5378
+ }, {
5379
+ x: 0,
5380
+ y: 0
5381
+ }, {
5382
+ x: 0,
5383
+ y: 0
5384
+ }],
5385
+ indexList = [1, 2, 3, 0, 1, 2, 3, 0];
5386
+ function circleBounds(startAngle, endAngle, radius, bounds) {
5387
+ for (; startAngle >= vutils.pi2;) startAngle -= vutils.pi2;
5388
+ for (; startAngle < 0;) startAngle += vutils.pi2;
5389
+ for (; startAngle > endAngle;) endAngle += vutils.pi2;
5390
+ _coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
5391
+ var startIdx = Math.ceil(startAngle / vutils.halfPi) % 4,
5392
+ endIdx = Math.ceil(endAngle / vutils.halfPi) % 4;
5393
+ if (bounds.add(vutils.cos(startAngle) * radius, vutils.sin(startAngle) * radius), bounds.add(vutils.cos(endAngle) * radius, vutils.sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > vutils.pi) {
5394
+ var match = !1;
5395
+ for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
5396
+ if (match && endIdx === indexList[i]) break;
5397
+ if (match) {
5398
+ var p = _coords[indexList[i]];
5399
+ bounds.add(p.x, p.y);
5400
+ }
5401
+ } else {
5402
+ match = !0;
5403
+ var _p = _coords[startIdx];
5404
+ bounds.add(_p.x, _p.y);
5405
+ }
5406
+ }
5407
+ }
5408
+ function pointInterpolation(pointA, pointB, ratio) {
5409
+ var _pointAt = vutils.pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
5410
+ x = _pointAt.x,
5411
+ y = _pointAt.y,
5412
+ _pointAt2 = vutils.pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
5413
+ x1 = _pointAt2.x,
5414
+ y1 = _pointAt2.y,
5415
+ point = new vutils.Point(x, y, x1, y1);
5416
+ return point.defined = pointB.defined, point;
5417
+ }
5418
+ function pointsInterpolation(pointsA, pointsB, ratio) {
5419
+ if (!pointsA || !pointsB) return [];
5420
+ Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
5421
+ var points = [];
5422
+ if (pointsA.length > pointsB.length) {
5423
+ points = pointsB.map(function (point) {
5424
+ var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
5425
+ return p.defined = point.defined, p;
5426
+ });
5427
+ for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
5428
+ } else {
5429
+ points = pointsB.map(function (point) {
5430
+ var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
5431
+ return p.defined = point.defined, p;
5432
+ });
5433
+ for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
5434
+ }
5435
+ return points;
5436
+ }
5437
+ function getAttributeFromDefaultAttrList(attr, key) {
5438
+ if (vutils.isArray(attr)) {
5439
+ var val;
5440
+ for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
5441
+ return val;
5442
+ }
5443
+ return attr[key];
5444
+ }
5445
+ var RafBasedSTO = /*#__PURE__*/function () {
5446
+ function RafBasedSTO() {
5447
+ _classCallCheck(this, RafBasedSTO);
5448
+ this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
5449
+ }
5450
+ _createClass(RafBasedSTO, [{
5451
+ key: "call",
5452
+ value: function call(cb) {
5453
+ var _this = this;
5454
+ return this.lastDate = Date.now(), setTimeout(function () {
5455
+ _this.appendDuration(Date.now() - _this.lastDate), cb(0);
5456
+ }, this.timeout, !0);
5457
+ }
5458
+ }, {
5459
+ key: "clear",
5460
+ value: function clear(h) {
5461
+ clearTimeout(h);
5462
+ }
5463
+ }, {
5464
+ key: "appendDuration",
5465
+ value: function appendDuration(d) {
5466
+ this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
5467
+ return a + b;
5468
+ }, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
5469
+ }
5470
+ }]);
5471
+ return RafBasedSTO;
5472
+ }();
5473
+ RafBasedSTO.TimeOut = 1e3 / 60;
5474
+ new RafBasedSTO();
5475
+ var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
5476
+ if (vutils.isString(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
5477
+ return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
5478
+ }
5479
+ return lineHeight;
5480
+ };
5481
+
5351
5482
  var __decorate$U = undefined && undefined.__decorate || function (decorators, target, key, desc) {
5352
5483
  var d,
5353
5484
  c = arguments.length,
@@ -5424,7 +5555,9 @@
5424
5555
  },
5425
5556
  getTextBounds: void 0,
5426
5557
  specialCharSet: "-/: .,@%'\"~" + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
5427
- }, null != option ? option : {}), textSpec);
5558
+ }, null != option ? option : {}), Object.assign(Object.assign({}, textSpec), {
5559
+ lineHeight: calculateLineHeight(null == textSpec ? void 0 : textSpec.lineHeight, null == textSpec ? void 0 : textSpec.fontSize)
5560
+ }));
5428
5561
  }
5429
5562
  }]);
5430
5563
  return DefaultGraphicUtil;
@@ -7339,137 +7472,6 @@
7339
7472
  easing: "cubicOut"
7340
7473
  };
7341
7474
 
7342
- var Edge;
7343
- !function (Edge) {
7344
- Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
7345
- }(Edge || (Edge = {}));
7346
- var _strokeVec4 = [!1, !1, !1, !1];
7347
- var parseStroke = function parseStroke(stroke) {
7348
- var _a;
7349
- var isFullStroke = !0;
7350
- if (vutils.isBoolean(stroke, !0)) {
7351
- for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
7352
- isFullStroke = stroke;
7353
- } else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
7354
- return {
7355
- isFullStroke: isFullStroke,
7356
- stroke: _strokeVec4
7357
- };
7358
- };
7359
- var _paddingVec4 = [0, 0, 0, 0];
7360
- var parsePadding = function parsePadding(padding) {
7361
- return padding ? vutils.isArray(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
7362
- };
7363
- var _coords = [{
7364
- x: 0,
7365
- y: 0
7366
- }, {
7367
- x: 0,
7368
- y: 0
7369
- }, {
7370
- x: 0,
7371
- y: 0
7372
- }, {
7373
- x: 0,
7374
- y: 0
7375
- }],
7376
- indexList = [1, 2, 3, 0, 1, 2, 3, 0];
7377
- function circleBounds(startAngle, endAngle, radius, bounds) {
7378
- for (; startAngle >= vutils.pi2;) startAngle -= vutils.pi2;
7379
- for (; startAngle < 0;) startAngle += vutils.pi2;
7380
- for (; startAngle > endAngle;) endAngle += vutils.pi2;
7381
- _coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
7382
- var startIdx = Math.ceil(startAngle / vutils.halfPi) % 4,
7383
- endIdx = Math.ceil(endAngle / vutils.halfPi) % 4;
7384
- if (bounds.add(vutils.cos(startAngle) * radius, vutils.sin(startAngle) * radius), bounds.add(vutils.cos(endAngle) * radius, vutils.sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > vutils.pi) {
7385
- var match = !1;
7386
- for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
7387
- if (match && endIdx === indexList[i]) break;
7388
- if (match) {
7389
- var p = _coords[indexList[i]];
7390
- bounds.add(p.x, p.y);
7391
- }
7392
- } else {
7393
- match = !0;
7394
- var _p = _coords[startIdx];
7395
- bounds.add(_p.x, _p.y);
7396
- }
7397
- }
7398
- }
7399
- function pointInterpolation(pointA, pointB, ratio) {
7400
- var _pointAt = vutils.pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
7401
- x = _pointAt.x,
7402
- y = _pointAt.y,
7403
- _pointAt2 = vutils.pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
7404
- x1 = _pointAt2.x,
7405
- y1 = _pointAt2.y,
7406
- point = new vutils.Point(x, y, x1, y1);
7407
- return point.defined = pointB.defined, point;
7408
- }
7409
- function pointsInterpolation(pointsA, pointsB, ratio) {
7410
- if (!pointsA || !pointsB) return [];
7411
- Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
7412
- var points = [];
7413
- if (pointsA.length > pointsB.length) {
7414
- points = pointsB.map(function (point) {
7415
- var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
7416
- return p.defined = point.defined, p;
7417
- });
7418
- for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
7419
- } else {
7420
- points = pointsB.map(function (point) {
7421
- var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
7422
- return p.defined = point.defined, p;
7423
- });
7424
- for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
7425
- }
7426
- return points;
7427
- }
7428
- function getAttributeFromDefaultAttrList(attr, key) {
7429
- if (vutils.isArray(attr)) {
7430
- var val;
7431
- for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
7432
- return val;
7433
- }
7434
- return attr[key];
7435
- }
7436
- var RafBasedSTO = /*#__PURE__*/function () {
7437
- function RafBasedSTO() {
7438
- _classCallCheck(this, RafBasedSTO);
7439
- this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
7440
- }
7441
- _createClass(RafBasedSTO, [{
7442
- key: "call",
7443
- value: function call(cb) {
7444
- var _this = this;
7445
- return this.lastDate = Date.now(), setTimeout(function () {
7446
- _this.appendDuration(Date.now() - _this.lastDate), cb(0);
7447
- }, this.timeout, !0);
7448
- }
7449
- }, {
7450
- key: "clear",
7451
- value: function clear(h) {
7452
- clearTimeout(h);
7453
- }
7454
- }, {
7455
- key: "appendDuration",
7456
- value: function appendDuration(d) {
7457
- this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
7458
- return a + b;
7459
- }, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
7460
- }
7461
- }]);
7462
- return RafBasedSTO;
7463
- }();
7464
- RafBasedSTO.TimeOut = 1e3 / 60;
7465
- new RafBasedSTO();
7466
- var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
7467
- if (vutils.isString(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
7468
- return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
7469
- }
7470
- return lineHeight;
7471
- };
7472
-
7473
7475
  var IncreaseCount = /*#__PURE__*/function (_ACustomAnimate) {
7474
7476
  _inherits(IncreaseCount, _ACustomAnimate);
7475
7477
  var _super = _createSuper(IncreaseCount);
@@ -8586,8 +8588,7 @@
8586
8588
  }, {
8587
8589
  key: "addChild",
8588
8590
  value: function addChild(node) {
8589
- var _this$child$push2;
8590
- "__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push((_this$child$push2 = {}, _defineProperty(_this$child$push2, node.tagname, node.child), _defineProperty(_this$child$push2, ":@", node[":@"]), _this$child$push2)) : this.child.push(_defineProperty({}, node.tagname, node.child));
8591
+ "__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push(_defineProperty(_defineProperty({}, node.tagname, node.child), ":@", node[":@"])) : this.child.push(_defineProperty({}, node.tagname, node.child));
8591
8592
  }
8592
8593
  }]);
8593
8594
  return XmlNode;
@@ -10050,7 +10051,7 @@
10050
10051
  }, {
10051
10052
  key: "updateWrapAABBBounds",
10052
10053
  value: function updateWrapAABBBounds(text) {
10053
- var _a, _b, _c;
10054
+ var _a, _b, _c, _d;
10054
10055
  var textTheme = getTheme(this).text,
10055
10056
  _this$attribute = this.attribute,
10056
10057
  _this$attribute$fontF = _this$attribute.fontFamily,
@@ -10061,8 +10062,6 @@
10061
10062
  textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
10062
10063
  _this$attribute$fontS = _this$attribute.fontSize,
10063
10064
  fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
10064
- _this$attribute$lineH = _this$attribute.lineHeight,
10065
- lineHeight = _this$attribute$lineH === void 0 ? calculateLineHeight(this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize, this.attribute.fontSize || textTheme.fontSize) : _this$attribute$lineH,
10066
10065
  _this$attribute$ellip = _this$attribute.ellipsis,
10067
10066
  ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
10068
10067
  maxLineWidth = _this$attribute.maxLineWidth,
@@ -10079,8 +10078,9 @@
10079
10078
  _this$attribute$heigh = _this$attribute.heightLimit,
10080
10079
  heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
10081
10080
  lineClamp = _this$attribute.lineClamp,
10081
+ lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
10082
10082
  buf = ignoreBuf ? 0 : 2;
10083
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
10083
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
10084
10084
  var _bbox = this.cache.layoutData.bbox;
10085
10085
  return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
10086
10086
  }
@@ -10112,7 +10112,7 @@
10112
10112
  if ("" !== str && "" === clip.str) {
10113
10113
  if (ellipsis) {
10114
10114
  var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
10115
- clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
10115
+ clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
10116
10116
  } else clip.str = "", clip.width = 0;
10117
10117
  needCut = !1;
10118
10118
  }
@@ -10210,8 +10210,7 @@
10210
10210
  if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
10211
10211
  var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
10212
10212
  textFontSize = attribute.fontSize || textTheme.fontSize,
10213
- _attribute$lineHeight = attribute.lineHeight,
10214
- lineHeight = _attribute$lineHeight === void 0 ? calculateLineHeight(null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : textFontSize, textFontSize) + buf : _attribute$lineHeight;
10213
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
10215
10214
  if (!this.shouldUpdateShape() && this.cache) {
10216
10215
  width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
10217
10216
  var _dx = textDrawOffsetX(textAlign, width),
@@ -10281,12 +10280,11 @@
10281
10280
  fontFamily = _attribute$fontFamily2 === void 0 ? textTheme.fontFamily : _attribute$fontFamily2,
10282
10281
  _attribute$stroke2 = attribute.stroke,
10283
10282
  stroke = _attribute$stroke2 === void 0 ? textTheme.stroke : _attribute$stroke2,
10284
- _attribute$lineHeight2 = attribute.lineHeight,
10285
- lineHeight = _attribute$lineHeight2 === void 0 ? calculateLineHeight(null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize, attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight2,
10286
10283
  _attribute$lineWidth2 = attribute.lineWidth,
10287
10284
  lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
10288
10285
  _attribute$verticalMo = attribute.verticalMode,
10289
- verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo;
10286
+ verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo,
10287
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
10290
10288
  var _attribute$textAlign2 = attribute.textAlign,
10291
10289
  textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
10292
10290
  _attribute$textBaseli2 = attribute.textBaseline,
@@ -10336,7 +10334,7 @@
10336
10334
  }, {
10337
10335
  key: "updateHorizontalMultilineAABBBounds",
10338
10336
  value: function updateHorizontalMultilineAABBBounds(text) {
10339
- var _a;
10337
+ var _a, _b;
10340
10338
  var textTheme = getTheme(this).text,
10341
10339
  attribute = this.attribute,
10342
10340
  _attribute$fontFamily3 = attribute.fontFamily,
@@ -10349,8 +10347,6 @@
10349
10347
  fontSize = _attribute$fontSize3 === void 0 ? textTheme.fontSize : _attribute$fontSize3,
10350
10348
  _attribute$fontWeight3 = attribute.fontWeight,
10351
10349
  fontWeight = _attribute$fontWeight3 === void 0 ? textTheme.fontWeight : _attribute$fontWeight3,
10352
- _attribute$lineHeight3 = attribute.lineHeight,
10353
- lineHeight = _attribute$lineHeight3 === void 0 ? calculateLineHeight(attribute.lineHeight || attribute.fontSize || textTheme.fontSize, attribute.fontSize || textTheme.fontSize) : _attribute$lineHeight3,
10354
10350
  _attribute$ellipsis3 = attribute.ellipsis,
10355
10351
  ellipsis = _attribute$ellipsis3 === void 0 ? textTheme.ellipsis : _attribute$ellipsis3,
10356
10352
  maxLineWidth = attribute.maxLineWidth,
@@ -10359,9 +10355,10 @@
10359
10355
  _attribute$lineWidth3 = attribute.lineWidth,
10360
10356
  lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
10361
10357
  _attribute$whiteSpace2 = attribute.whiteSpace,
10362
- whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2;
10358
+ whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2,
10359
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
10363
10360
  if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
10364
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
10361
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
10365
10362
  var _bbox2 = this.cache.layoutData.bbox;
10366
10363
  return this._AABBBounds.set(_bbox2.xOffset, _bbox2.yOffset, _bbox2.xOffset + _bbox2.width, _bbox2.yOffset + _bbox2.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
10367
10364
  }
@@ -10397,12 +10394,11 @@
10397
10394
  fontWeight = _attribute$fontWeight4 === void 0 ? textTheme.fontWeight : _attribute$fontWeight4,
10398
10395
  _attribute$stroke4 = attribute.stroke,
10399
10396
  stroke = _attribute$stroke4 === void 0 ? textTheme.stroke : _attribute$stroke4,
10400
- _attribute$lineHeight4 = attribute.lineHeight,
10401
- lineHeight = _attribute$lineHeight4 === void 0 ? calculateLineHeight(null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize, attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight4,
10402
10397
  _attribute$lineWidth4 = attribute.lineWidth,
10403
10398
  lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
10404
10399
  _attribute$verticalMo2 = attribute.verticalMode,
10405
- verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2;
10400
+ verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2,
10401
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
10406
10402
  var _attribute$textAlign4 = attribute.textAlign,
10407
10403
  textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
10408
10404
  _attribute$textBaseli4 = attribute.textBaseline,
@@ -10535,7 +10531,7 @@
10535
10531
  }, {
10536
10532
  key: "updateMultilineAABBBounds",
10537
10533
  value: function updateMultilineAABBBounds(text) {
10538
- var _a, _b, _c;
10534
+ var _a, _b, _c, _d;
10539
10535
  var textTheme = getTheme(this).text,
10540
10536
  _this$attribute = this.attribute,
10541
10537
  _this$attribute$fontF = _this$attribute.fontFamily,
@@ -10546,8 +10542,6 @@
10546
10542
  textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
10547
10543
  _this$attribute$fontS = _this$attribute.fontSize,
10548
10544
  fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
10549
- _this$attribute$lineH = _this$attribute.lineHeight,
10550
- lineHeight = _this$attribute$lineH === void 0 ? calculateLineHeight(this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize, this.attribute.fontSize || textTheme.fontSize) : _this$attribute$lineH,
10551
10545
  _this$attribute$ellip = _this$attribute.ellipsis,
10552
10546
  ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
10553
10547
  maxLineWidth = _this$attribute.maxLineWidth,
@@ -10564,8 +10558,9 @@
10564
10558
  _this$attribute$heigh = _this$attribute.heightLimit,
10565
10559
  heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
10566
10560
  lineClamp = _this$attribute.lineClamp,
10561
+ lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
10567
10562
  buf = ignoreBuf ? 0 : 2;
10568
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
10563
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
10569
10564
  var _bbox = this.cache.layoutData.bbox;
10570
10565
  return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
10571
10566
  }
@@ -10597,7 +10592,7 @@
10597
10592
  if ("" !== str && "" === clip.str) {
10598
10593
  if (ellipsis) {
10599
10594
  var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
10600
- clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
10595
+ clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
10601
10596
  } else clip.str = "", clip.width = 0;
10602
10597
  needCut = !1;
10603
10598
  }
@@ -15468,7 +15463,7 @@
15468
15463
  var t = textAlign;
15469
15464
  textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
15470
15465
  }
15471
- var lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
15466
+ var lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
15472
15467
  data = this.valid(text, textAttribute, fillCb, strokeCb);
15473
15468
  if (!data) return;
15474
15469
  var fVisible = data.fVisible,
@@ -20952,7 +20947,7 @@
20952
20947
  return new vutils.TextMeasure(Object.assign({ defaultFontParams: {
20953
20948
  fontFamily: DEFAULT_TEXT_FONT_FAMILY,
20954
20949
  fontSize: DEFAULT_TEXT_FONT_SIZE
20955
- }, getTextBounds: useNaiveCanvas ? undefined : getTextBounds, specialCharSet: '-/: .,@%\'"~' + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})), textSpec);
20950
+ }, getTextBounds: useNaiveCanvas ? undefined : getTextBounds, specialCharSet: '-/: .,@%\'"~' + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})), Object.assign(Object.assign({}, textSpec), { lineHeight: calculateLineHeight(textSpec === null || textSpec === void 0 ? void 0 : textSpec.lineHeight, textSpec === null || textSpec === void 0 ? void 0 : textSpec.fontSize) }));
20956
20951
  };
20957
20952
  function measureTextSize(text, textSpec) {
20958
20953
  var _a;
@@ -31030,7 +31025,9 @@
31030
31025
  let x = 0;
31031
31026
  if (isVisible(itemAttr.shape)) {
31032
31027
  itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, Object.assign({ visible: true, x: itemAttr.shape.size / 2, y: itemAttr.shape.size / 2 +
31033
- (((_a = itemAttr.key.lineHeight) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) - itemAttr.shape.size) / 2 }, itemAttr.shape), 'symbol');
31028
+ (((_a = calculateLineHeight(itemAttr.key.lineHeight, itemAttr.key.fontSize)) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) -
31029
+ itemAttr.shape.size) /
31030
+ 2 }, itemAttr.shape), 'symbol');
31034
31031
  }
31035
31032
  if (hasContentShape) {
31036
31033
  x += itemAttr.shape.size + itemAttr.shape.spacing;
@@ -31411,7 +31408,7 @@
31411
31408
  }
31412
31409
  };
31413
31410
 
31414
- const version = "0.16.14-alpha.1";
31411
+ const version = "0.16.14-alpha.3";
31415
31412
 
31416
31413
  exports.AbstractComponent = AbstractComponent;
31417
31414
  exports.ArcInfo = ArcInfo;