@visactor/vrender 0.16.14-alpha.3 → 0.16.14-alpha.4
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 +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +175 -310
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +3 -3
package/cjs/index.d.ts
CHANGED
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.16.14-alpha.
|
|
24
|
+
exports.version = "0.16.14-alpha.4", (0, vrender_kits_1.loadAllModule)(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,yDAAuD;AAG1C,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.14-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAuD;AAG1C,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.14-alpha.4\";\n\nloadAllModule(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -6285,10 +6285,7 @@
|
|
|
6285
6285
|
direction: "horizontal",
|
|
6286
6286
|
wordBreak: "break-all",
|
|
6287
6287
|
ignoreBuf: !1,
|
|
6288
|
-
verticalMode: 0
|
|
6289
|
-
whiteSpace: "no-wrap",
|
|
6290
|
-
heightLimit: 1 / 0,
|
|
6291
|
-
lineClamp: 1 / 0
|
|
6288
|
+
verticalMode: 0
|
|
6292
6289
|
};
|
|
6293
6290
|
var DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
6294
6291
|
opacity: 1,
|
|
@@ -7178,158 +7175,6 @@
|
|
|
7178
7175
|
return containPath(commands, lineWidth, !0, x, y);
|
|
7179
7176
|
}
|
|
7180
7177
|
|
|
7181
|
-
exports.Edge = void 0;
|
|
7182
|
-
!function (Edge) {
|
|
7183
|
-
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";
|
|
7184
|
-
}(exports.Edge || (exports.Edge = {}));
|
|
7185
|
-
var _strokeVec4 = [!1, !1, !1, !1];
|
|
7186
|
-
var parseStroke = function parseStroke(stroke) {
|
|
7187
|
-
var _a;
|
|
7188
|
-
var isFullStroke = !0;
|
|
7189
|
-
if (isBoolean$1(stroke, !0)) {
|
|
7190
|
-
for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
7191
|
-
isFullStroke = stroke;
|
|
7192
|
-
} 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;
|
|
7193
|
-
return {
|
|
7194
|
-
isFullStroke: isFullStroke,
|
|
7195
|
-
stroke: _strokeVec4
|
|
7196
|
-
};
|
|
7197
|
-
};
|
|
7198
|
-
var _paddingVec4 = [0, 0, 0, 0];
|
|
7199
|
-
var parsePadding = function parsePadding(padding) {
|
|
7200
|
-
return padding ? isArray$1(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;
|
|
7201
|
-
};
|
|
7202
|
-
var _coords = [{
|
|
7203
|
-
x: 0,
|
|
7204
|
-
y: 0
|
|
7205
|
-
}, {
|
|
7206
|
-
x: 0,
|
|
7207
|
-
y: 0
|
|
7208
|
-
}, {
|
|
7209
|
-
x: 0,
|
|
7210
|
-
y: 0
|
|
7211
|
-
}, {
|
|
7212
|
-
x: 0,
|
|
7213
|
-
y: 0
|
|
7214
|
-
}],
|
|
7215
|
-
indexList = [1, 2, 3, 0, 1, 2, 3, 0];
|
|
7216
|
-
function circleBounds(startAngle, endAngle, radius, bounds) {
|
|
7217
|
-
for (; startAngle >= pi2;) startAngle -= pi2;
|
|
7218
|
-
for (; startAngle < 0;) startAngle += pi2;
|
|
7219
|
-
for (; startAngle > endAngle;) endAngle += pi2;
|
|
7220
|
-
_coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
|
|
7221
|
-
var startIdx = Math.ceil(startAngle / halfPi$1) % 4,
|
|
7222
|
-
endIdx = Math.ceil(endAngle / halfPi$1) % 4;
|
|
7223
|
-
if (bounds.add(cos(startAngle) * radius, sin(startAngle) * radius), bounds.add(cos(endAngle) * radius, sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > pi) {
|
|
7224
|
-
var match = !1;
|
|
7225
|
-
for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
|
|
7226
|
-
if (match && endIdx === indexList[i]) break;
|
|
7227
|
-
if (match) {
|
|
7228
|
-
var p = _coords[indexList[i]];
|
|
7229
|
-
bounds.add(p.x, p.y);
|
|
7230
|
-
}
|
|
7231
|
-
} else {
|
|
7232
|
-
match = !0;
|
|
7233
|
-
var _p = _coords[startIdx];
|
|
7234
|
-
bounds.add(_p.x, _p.y);
|
|
7235
|
-
}
|
|
7236
|
-
}
|
|
7237
|
-
}
|
|
7238
|
-
function pointsEqual(pointsA, pointsB) {
|
|
7239
|
-
return !(!pointsA || !pointsB) && (Array.isArray(pointsA) && Array.isArray(pointsB) ? pointsA.length === pointsB.length && pointsA.every(function (point, index) {
|
|
7240
|
-
return pointEqual(point, pointsB[index]);
|
|
7241
|
-
}) : !Number.isNaN(pointsA.x + pointsA.y) && pointEqual(pointsA, pointsB));
|
|
7242
|
-
}
|
|
7243
|
-
function pointEqual(pointA, pointB) {
|
|
7244
|
-
return pointA.x === pointB.x && pointA.y === pointB.y && pointA.x1 === pointB.x1 && pointA.y1 === pointB.y1 && pointA.defined === pointB.defined;
|
|
7245
|
-
}
|
|
7246
|
-
function pointInterpolation(pointA, pointB, ratio) {
|
|
7247
|
-
var _pointAt = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
7248
|
-
x = _pointAt.x,
|
|
7249
|
-
y = _pointAt.y,
|
|
7250
|
-
_pointAt2 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
7251
|
-
x1 = _pointAt2.x,
|
|
7252
|
-
y1 = _pointAt2.y,
|
|
7253
|
-
point = new Point(x, y, x1, y1);
|
|
7254
|
-
return point.defined = pointB.defined, point;
|
|
7255
|
-
}
|
|
7256
|
-
function pointInterpolationHighPerformance(pointA, pointB, ratio, point) {
|
|
7257
|
-
var _pointAt3 = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
7258
|
-
x = _pointAt3.x,
|
|
7259
|
-
y = _pointAt3.y,
|
|
7260
|
-
_pointAt4 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
7261
|
-
x1 = _pointAt4.x,
|
|
7262
|
-
y1 = _pointAt4.y;
|
|
7263
|
-
return point.x = x, point.y = y, point.x1 = x1, point.y1 = y1, point.defined = pointB.defined, point;
|
|
7264
|
-
}
|
|
7265
|
-
function pointsInterpolation(pointsA, pointsB, ratio) {
|
|
7266
|
-
if (!pointsA || !pointsB) return [];
|
|
7267
|
-
Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
|
|
7268
|
-
var points = [];
|
|
7269
|
-
if (pointsA.length > pointsB.length) {
|
|
7270
|
-
points = pointsB.map(function (point) {
|
|
7271
|
-
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
7272
|
-
return p.defined = point.defined, p;
|
|
7273
|
-
});
|
|
7274
|
-
for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
|
|
7275
|
-
} else {
|
|
7276
|
-
points = pointsB.map(function (point) {
|
|
7277
|
-
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
7278
|
-
return p.defined = point.defined, p;
|
|
7279
|
-
});
|
|
7280
|
-
for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
|
|
7281
|
-
}
|
|
7282
|
-
return points;
|
|
7283
|
-
}
|
|
7284
|
-
var transformKeys = ["x", "y", "dx", "dy", "scaleX", "scaleY", "angle", "anchor", "postMatrix", "scrollX", "scrollY"];
|
|
7285
|
-
var isTransformKey = function isTransformKey(key) {
|
|
7286
|
-
return transformKeys.includes(key);
|
|
7287
|
-
};
|
|
7288
|
-
function getAttributeFromDefaultAttrList(attr, key) {
|
|
7289
|
-
if (isArray$1(attr)) {
|
|
7290
|
-
var val;
|
|
7291
|
-
for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
7292
|
-
return val;
|
|
7293
|
-
}
|
|
7294
|
-
return attr[key];
|
|
7295
|
-
}
|
|
7296
|
-
var RafBasedSTO = /*#__PURE__*/function () {
|
|
7297
|
-
function RafBasedSTO() {
|
|
7298
|
-
_classCallCheck(this, RafBasedSTO);
|
|
7299
|
-
this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
7300
|
-
}
|
|
7301
|
-
_createClass(RafBasedSTO, [{
|
|
7302
|
-
key: "call",
|
|
7303
|
-
value: function call(cb) {
|
|
7304
|
-
var _this = this;
|
|
7305
|
-
return this.lastDate = Date.now(), setTimeout(function () {
|
|
7306
|
-
_this.appendDuration(Date.now() - _this.lastDate), cb(0);
|
|
7307
|
-
}, this.timeout, !0);
|
|
7308
|
-
}
|
|
7309
|
-
}, {
|
|
7310
|
-
key: "clear",
|
|
7311
|
-
value: function clear(h) {
|
|
7312
|
-
clearTimeout(h);
|
|
7313
|
-
}
|
|
7314
|
-
}, {
|
|
7315
|
-
key: "appendDuration",
|
|
7316
|
-
value: function appendDuration(d) {
|
|
7317
|
-
this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
|
|
7318
|
-
return a + b;
|
|
7319
|
-
}, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
|
|
7320
|
-
}
|
|
7321
|
-
}]);
|
|
7322
|
-
return RafBasedSTO;
|
|
7323
|
-
}();
|
|
7324
|
-
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
7325
|
-
var rafBasedSto = new RafBasedSTO();
|
|
7326
|
-
var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
|
|
7327
|
-
if (isString$1(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
7328
|
-
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
7329
|
-
}
|
|
7330
|
-
return lineHeight;
|
|
7331
|
-
};
|
|
7332
|
-
|
|
7333
7178
|
var __decorate$1P = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
7334
7179
|
var d,
|
|
7335
7180
|
c = arguments.length,
|
|
@@ -7406,9 +7251,7 @@
|
|
|
7406
7251
|
},
|
|
7407
7252
|
getTextBounds: void 0,
|
|
7408
7253
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
7409
|
-
}, null != option ? option : {}),
|
|
7410
|
-
lineHeight: calculateLineHeight(null == textSpec ? void 0 : textSpec.lineHeight, null == textSpec ? void 0 : textSpec.fontSize)
|
|
7411
|
-
}));
|
|
7254
|
+
}, null != option ? option : {}), textSpec);
|
|
7412
7255
|
}
|
|
7413
7256
|
}]);
|
|
7414
7257
|
return DefaultGraphicUtil;
|
|
@@ -9956,6 +9799,152 @@
|
|
|
9956
9799
|
easing: "quadInOut"
|
|
9957
9800
|
};
|
|
9958
9801
|
|
|
9802
|
+
exports.Edge = void 0;
|
|
9803
|
+
!function (Edge) {
|
|
9804
|
+
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";
|
|
9805
|
+
}(exports.Edge || (exports.Edge = {}));
|
|
9806
|
+
var _strokeVec4 = [!1, !1, !1, !1];
|
|
9807
|
+
var parseStroke = function parseStroke(stroke) {
|
|
9808
|
+
var _a;
|
|
9809
|
+
var isFullStroke = !0;
|
|
9810
|
+
if (isBoolean$1(stroke, !0)) {
|
|
9811
|
+
for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
9812
|
+
isFullStroke = stroke;
|
|
9813
|
+
} 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;
|
|
9814
|
+
return {
|
|
9815
|
+
isFullStroke: isFullStroke,
|
|
9816
|
+
stroke: _strokeVec4
|
|
9817
|
+
};
|
|
9818
|
+
};
|
|
9819
|
+
var _paddingVec4 = [0, 0, 0, 0];
|
|
9820
|
+
var parsePadding = function parsePadding(padding) {
|
|
9821
|
+
return padding ? isArray$1(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;
|
|
9822
|
+
};
|
|
9823
|
+
var _coords = [{
|
|
9824
|
+
x: 0,
|
|
9825
|
+
y: 0
|
|
9826
|
+
}, {
|
|
9827
|
+
x: 0,
|
|
9828
|
+
y: 0
|
|
9829
|
+
}, {
|
|
9830
|
+
x: 0,
|
|
9831
|
+
y: 0
|
|
9832
|
+
}, {
|
|
9833
|
+
x: 0,
|
|
9834
|
+
y: 0
|
|
9835
|
+
}],
|
|
9836
|
+
indexList = [1, 2, 3, 0, 1, 2, 3, 0];
|
|
9837
|
+
function circleBounds(startAngle, endAngle, radius, bounds) {
|
|
9838
|
+
for (; startAngle >= pi2;) startAngle -= pi2;
|
|
9839
|
+
for (; startAngle < 0;) startAngle += pi2;
|
|
9840
|
+
for (; startAngle > endAngle;) endAngle += pi2;
|
|
9841
|
+
_coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
|
|
9842
|
+
var startIdx = Math.ceil(startAngle / halfPi$1) % 4,
|
|
9843
|
+
endIdx = Math.ceil(endAngle / halfPi$1) % 4;
|
|
9844
|
+
if (bounds.add(cos(startAngle) * radius, sin(startAngle) * radius), bounds.add(cos(endAngle) * radius, sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > pi) {
|
|
9845
|
+
var match = !1;
|
|
9846
|
+
for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
|
|
9847
|
+
if (match && endIdx === indexList[i]) break;
|
|
9848
|
+
if (match) {
|
|
9849
|
+
var p = _coords[indexList[i]];
|
|
9850
|
+
bounds.add(p.x, p.y);
|
|
9851
|
+
}
|
|
9852
|
+
} else {
|
|
9853
|
+
match = !0;
|
|
9854
|
+
var _p = _coords[startIdx];
|
|
9855
|
+
bounds.add(_p.x, _p.y);
|
|
9856
|
+
}
|
|
9857
|
+
}
|
|
9858
|
+
}
|
|
9859
|
+
function pointsEqual(pointsA, pointsB) {
|
|
9860
|
+
return !(!pointsA || !pointsB) && (Array.isArray(pointsA) && Array.isArray(pointsB) ? pointsA.length === pointsB.length && pointsA.every(function (point, index) {
|
|
9861
|
+
return pointEqual(point, pointsB[index]);
|
|
9862
|
+
}) : !Number.isNaN(pointsA.x + pointsA.y) && pointEqual(pointsA, pointsB));
|
|
9863
|
+
}
|
|
9864
|
+
function pointEqual(pointA, pointB) {
|
|
9865
|
+
return pointA.x === pointB.x && pointA.y === pointB.y && pointA.x1 === pointB.x1 && pointA.y1 === pointB.y1 && pointA.defined === pointB.defined;
|
|
9866
|
+
}
|
|
9867
|
+
function pointInterpolation(pointA, pointB, ratio) {
|
|
9868
|
+
var _pointAt = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
9869
|
+
x = _pointAt.x,
|
|
9870
|
+
y = _pointAt.y,
|
|
9871
|
+
_pointAt2 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
9872
|
+
x1 = _pointAt2.x,
|
|
9873
|
+
y1 = _pointAt2.y,
|
|
9874
|
+
point = new Point(x, y, x1, y1);
|
|
9875
|
+
return point.defined = pointB.defined, point;
|
|
9876
|
+
}
|
|
9877
|
+
function pointInterpolationHighPerformance(pointA, pointB, ratio, point) {
|
|
9878
|
+
var _pointAt3 = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
9879
|
+
x = _pointAt3.x,
|
|
9880
|
+
y = _pointAt3.y,
|
|
9881
|
+
_pointAt4 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
9882
|
+
x1 = _pointAt4.x,
|
|
9883
|
+
y1 = _pointAt4.y;
|
|
9884
|
+
return point.x = x, point.y = y, point.x1 = x1, point.y1 = y1, point.defined = pointB.defined, point;
|
|
9885
|
+
}
|
|
9886
|
+
function pointsInterpolation(pointsA, pointsB, ratio) {
|
|
9887
|
+
if (!pointsA || !pointsB) return [];
|
|
9888
|
+
Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
|
|
9889
|
+
var points = [];
|
|
9890
|
+
if (pointsA.length > pointsB.length) {
|
|
9891
|
+
points = pointsB.map(function (point) {
|
|
9892
|
+
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
9893
|
+
return p.defined = point.defined, p;
|
|
9894
|
+
});
|
|
9895
|
+
for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
|
|
9896
|
+
} else {
|
|
9897
|
+
points = pointsB.map(function (point) {
|
|
9898
|
+
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
9899
|
+
return p.defined = point.defined, p;
|
|
9900
|
+
});
|
|
9901
|
+
for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
|
|
9902
|
+
}
|
|
9903
|
+
return points;
|
|
9904
|
+
}
|
|
9905
|
+
var transformKeys = ["x", "y", "dx", "dy", "scaleX", "scaleY", "angle", "anchor", "postMatrix", "scrollX", "scrollY"];
|
|
9906
|
+
var isTransformKey = function isTransformKey(key) {
|
|
9907
|
+
return transformKeys.includes(key);
|
|
9908
|
+
};
|
|
9909
|
+
function getAttributeFromDefaultAttrList(attr, key) {
|
|
9910
|
+
if (isArray$1(attr)) {
|
|
9911
|
+
var val;
|
|
9912
|
+
for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
9913
|
+
return val;
|
|
9914
|
+
}
|
|
9915
|
+
return attr[key];
|
|
9916
|
+
}
|
|
9917
|
+
var RafBasedSTO = /*#__PURE__*/function () {
|
|
9918
|
+
function RafBasedSTO() {
|
|
9919
|
+
_classCallCheck(this, RafBasedSTO);
|
|
9920
|
+
this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
9921
|
+
}
|
|
9922
|
+
_createClass(RafBasedSTO, [{
|
|
9923
|
+
key: "call",
|
|
9924
|
+
value: function call(cb) {
|
|
9925
|
+
var _this = this;
|
|
9926
|
+
return this.lastDate = Date.now(), setTimeout(function () {
|
|
9927
|
+
_this.appendDuration(Date.now() - _this.lastDate), cb(0);
|
|
9928
|
+
}, this.timeout, !0);
|
|
9929
|
+
}
|
|
9930
|
+
}, {
|
|
9931
|
+
key: "clear",
|
|
9932
|
+
value: function clear(h) {
|
|
9933
|
+
clearTimeout(h);
|
|
9934
|
+
}
|
|
9935
|
+
}, {
|
|
9936
|
+
key: "appendDuration",
|
|
9937
|
+
value: function appendDuration(d) {
|
|
9938
|
+
this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
|
|
9939
|
+
return a + b;
|
|
9940
|
+
}, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
|
|
9941
|
+
}
|
|
9942
|
+
}]);
|
|
9943
|
+
return RafBasedSTO;
|
|
9944
|
+
}();
|
|
9945
|
+
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
9946
|
+
var rafBasedSto = new RafBasedSTO();
|
|
9947
|
+
|
|
9959
9948
|
var IncreaseCount = /*#__PURE__*/function (_ACustomAnimate) {
|
|
9960
9949
|
_inherits(IncreaseCount, _ACustomAnimate);
|
|
9961
9950
|
var _super = _createSuper(IncreaseCount);
|
|
@@ -14491,7 +14480,7 @@
|
|
|
14491
14480
|
return CanvasTextLayout;
|
|
14492
14481
|
}();
|
|
14493
14482
|
|
|
14494
|
-
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "
|
|
14483
|
+
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
14495
14484
|
var Text = /*#__PURE__*/function (_Graphic) {
|
|
14496
14485
|
_inherits(Text, _Graphic);
|
|
14497
14486
|
var _super = _createSuper(Text);
|
|
@@ -14565,117 +14554,6 @@
|
|
|
14565
14554
|
paddingArray = parsePadding(boundsPadding);
|
|
14566
14555
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
14567
14556
|
}
|
|
14568
|
-
}, {
|
|
14569
|
-
key: "updateWrapAABBBounds",
|
|
14570
|
-
value: function updateWrapAABBBounds(text) {
|
|
14571
|
-
var _a, _b, _c, _d;
|
|
14572
|
-
var textTheme = getTheme(this).text,
|
|
14573
|
-
_this$attribute = this.attribute,
|
|
14574
|
-
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
14575
|
-
fontFamily = _this$attribute$fontF === void 0 ? textTheme.fontFamily : _this$attribute$fontF,
|
|
14576
|
-
_this$attribute$textA = _this$attribute.textAlign,
|
|
14577
|
-
textAlign = _this$attribute$textA === void 0 ? textTheme.textAlign : _this$attribute$textA,
|
|
14578
|
-
_this$attribute$textB = _this$attribute.textBaseline,
|
|
14579
|
-
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
14580
|
-
_this$attribute$fontS = _this$attribute.fontSize,
|
|
14581
|
-
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
14582
|
-
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
14583
|
-
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
14584
|
-
maxLineWidth = _this$attribute.maxLineWidth,
|
|
14585
|
-
_this$attribute$strok = _this$attribute.stroke,
|
|
14586
|
-
stroke = _this$attribute$strok === void 0 ? textTheme.stroke : _this$attribute$strok,
|
|
14587
|
-
_this$attribute$lineW = _this$attribute.lineWidth,
|
|
14588
|
-
lineWidth = _this$attribute$lineW === void 0 ? textTheme.lineWidth : _this$attribute$lineW,
|
|
14589
|
-
_this$attribute$wordB = _this$attribute.wordBreak,
|
|
14590
|
-
wordBreak = _this$attribute$wordB === void 0 ? textTheme.wordBreak : _this$attribute$wordB,
|
|
14591
|
-
_this$attribute$fontW = _this$attribute.fontWeight,
|
|
14592
|
-
fontWeight = _this$attribute$fontW === void 0 ? textTheme.fontWeight : _this$attribute$fontW,
|
|
14593
|
-
_this$attribute$ignor = _this$attribute.ignoreBuf,
|
|
14594
|
-
ignoreBuf = _this$attribute$ignor === void 0 ? textTheme.ignoreBuf : _this$attribute$ignor,
|
|
14595
|
-
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
14596
|
-
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
14597
|
-
lineClamp = _this$attribute.lineClamp,
|
|
14598
|
-
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
14599
|
-
buf = ignoreBuf ? 0 : 2;
|
|
14600
|
-
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
14601
|
-
var _bbox = this.cache.layoutData.bbox;
|
|
14602
|
-
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14603
|
-
}
|
|
14604
|
-
var textMeasure = application.graphicUtil.textMeasure,
|
|
14605
|
-
layoutObj = new CanvasTextLayout(fontFamily, {
|
|
14606
|
-
fontSize: fontSize,
|
|
14607
|
-
fontWeight: fontWeight,
|
|
14608
|
-
fontFamily: fontFamily
|
|
14609
|
-
}, textMeasure),
|
|
14610
|
-
lines = isArray$1(text) ? text.map(function (l) {
|
|
14611
|
-
return l.toString();
|
|
14612
|
-
}) : [text.toString()],
|
|
14613
|
-
linesLayout = [],
|
|
14614
|
-
bboxWH = [0, 0];
|
|
14615
|
-
var lineCountLimit = 1 / 0;
|
|
14616
|
-
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
14617
|
-
if (maxLineWidth > 0) for (var i = 0; i < lines.length; i++) {
|
|
14618
|
-
var str = lines[i];
|
|
14619
|
-
var needCut = !0;
|
|
14620
|
-
if (i === lineCountLimit - 1) {
|
|
14621
|
-
var _clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
14622
|
-
linesLayout.push({
|
|
14623
|
-
str: _clip.str,
|
|
14624
|
-
width: _clip.width
|
|
14625
|
-
});
|
|
14626
|
-
break;
|
|
14627
|
-
}
|
|
14628
|
-
var clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
|
|
14629
|
-
if ("" !== str && "" === clip.str) {
|
|
14630
|
-
if (ellipsis) {
|
|
14631
|
-
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
14632
|
-
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
14633
|
-
} else clip.str = "", clip.width = 0;
|
|
14634
|
-
needCut = !1;
|
|
14635
|
-
}
|
|
14636
|
-
if (linesLayout.push({
|
|
14637
|
-
str: clip.str,
|
|
14638
|
-
width: clip.width
|
|
14639
|
-
}), clip.str.length === str.length) ;else if (needCut) {
|
|
14640
|
-
var newStr = str.substring(clip.str.length);
|
|
14641
|
-
lines.splice(i + 1, 0, newStr);
|
|
14642
|
-
}
|
|
14643
|
-
}
|
|
14644
|
-
var maxWidth = 0;
|
|
14645
|
-
linesLayout.forEach(function (layout) {
|
|
14646
|
-
maxWidth = Math.max(maxWidth, layout.width);
|
|
14647
|
-
}), bboxWH[0] = maxWidth;
|
|
14648
|
-
} else {
|
|
14649
|
-
var width,
|
|
14650
|
-
_text,
|
|
14651
|
-
_lineWidth = 0;
|
|
14652
|
-
for (var _i = 0, len = lines.length; _i < len; _i++) {
|
|
14653
|
-
if (_i === lineCountLimit - 1) {
|
|
14654
|
-
var _clip2 = layoutObj.textMeasure.clipTextWithSuffix(lines[_i], layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
14655
|
-
linesLayout.push({
|
|
14656
|
-
str: _clip2.str,
|
|
14657
|
-
width: _clip2.width
|
|
14658
|
-
}), _lineWidth = Math.max(_lineWidth, _clip2.width);
|
|
14659
|
-
break;
|
|
14660
|
-
}
|
|
14661
|
-
_text = lines[_i], width = layoutObj.textMeasure.measureTextWidth(_text, layoutObj.textOptions, "break-word" === wordBreak), _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
|
|
14662
|
-
str: _text,
|
|
14663
|
-
width: width
|
|
14664
|
-
});
|
|
14665
|
-
}
|
|
14666
|
-
bboxWH[0] = _lineWidth;
|
|
14667
|
-
}
|
|
14668
|
-
bboxWH[1] = linesLayout.length * (lineHeight + buf);
|
|
14669
|
-
var bbox = {
|
|
14670
|
-
xOffset: 0,
|
|
14671
|
-
yOffset: 0,
|
|
14672
|
-
width: bboxWH[0],
|
|
14673
|
-
height: bboxWH[1]
|
|
14674
|
-
};
|
|
14675
|
-
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
14676
|
-
var layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14677
|
-
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14678
|
-
}
|
|
14679
14557
|
}, {
|
|
14680
14558
|
key: "updateSingallineAABBBounds",
|
|
14681
14559
|
value: function updateSingallineAABBBounds(text) {
|
|
@@ -14722,12 +14600,9 @@
|
|
|
14722
14600
|
_attribute$wordBreak === void 0 ? textTheme.wordBreak : _attribute$wordBreak;
|
|
14723
14601
|
var _attribute$ignoreBuf = attribute.ignoreBuf,
|
|
14724
14602
|
ignoreBuf = _attribute$ignoreBuf === void 0 ? textTheme.ignoreBuf : _attribute$ignoreBuf,
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
14729
|
-
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
14730
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
14603
|
+
buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
14604
|
+
_attribute$lineHeight = attribute.lineHeight,
|
|
14605
|
+
lineHeight = _attribute$lineHeight === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight;
|
|
14731
14606
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
14732
14607
|
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
14733
14608
|
var _dx = textDrawOffsetX(textAlign, width),
|
|
@@ -14797,11 +14672,12 @@
|
|
|
14797
14672
|
fontFamily = _attribute$fontFamily2 === void 0 ? textTheme.fontFamily : _attribute$fontFamily2,
|
|
14798
14673
|
_attribute$stroke2 = attribute.stroke,
|
|
14799
14674
|
stroke = _attribute$stroke2 === void 0 ? textTheme.stroke : _attribute$stroke2,
|
|
14675
|
+
_attribute$lineHeight2 = attribute.lineHeight,
|
|
14676
|
+
lineHeight = _attribute$lineHeight2 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight2,
|
|
14800
14677
|
_attribute$lineWidth2 = attribute.lineWidth,
|
|
14801
14678
|
lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
|
|
14802
14679
|
_attribute$verticalMo = attribute.verticalMode,
|
|
14803
|
-
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo
|
|
14804
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
14680
|
+
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo;
|
|
14805
14681
|
var _attribute$textAlign2 = attribute.textAlign,
|
|
14806
14682
|
textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
|
|
14807
14683
|
_attribute$textBaseli2 = attribute.textBaseline,
|
|
@@ -14851,7 +14727,7 @@
|
|
|
14851
14727
|
}, {
|
|
14852
14728
|
key: "updateHorizontalMultilineAABBBounds",
|
|
14853
14729
|
value: function updateHorizontalMultilineAABBBounds(text) {
|
|
14854
|
-
var _a
|
|
14730
|
+
var _a;
|
|
14855
14731
|
var textTheme = getTheme(this).text,
|
|
14856
14732
|
attribute = this.attribute,
|
|
14857
14733
|
_attribute$fontFamily3 = attribute.fontFamily,
|
|
@@ -14864,6 +14740,8 @@
|
|
|
14864
14740
|
fontSize = _attribute$fontSize3 === void 0 ? textTheme.fontSize : _attribute$fontSize3,
|
|
14865
14741
|
_attribute$fontWeight3 = attribute.fontWeight,
|
|
14866
14742
|
fontWeight = _attribute$fontWeight3 === void 0 ? textTheme.fontWeight : _attribute$fontWeight3,
|
|
14743
|
+
_attribute$lineHeight3 = attribute.lineHeight,
|
|
14744
|
+
lineHeight = _attribute$lineHeight3 === void 0 ? attribute.lineHeight || attribute.fontSize || textTheme.fontSize : _attribute$lineHeight3,
|
|
14867
14745
|
_attribute$ellipsis3 = attribute.ellipsis,
|
|
14868
14746
|
ellipsis = _attribute$ellipsis3 === void 0 ? textTheme.ellipsis : _attribute$ellipsis3,
|
|
14869
14747
|
maxLineWidth = attribute.maxLineWidth,
|
|
@@ -14871,13 +14749,11 @@
|
|
|
14871
14749
|
stroke = _attribute$stroke3 === void 0 ? textTheme.stroke : _attribute$stroke3,
|
|
14872
14750
|
_attribute$lineWidth3 = attribute.lineWidth,
|
|
14873
14751
|
lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
|
|
14874
|
-
_attribute$
|
|
14875
|
-
|
|
14876
|
-
|
|
14877
|
-
|
|
14878
|
-
|
|
14879
|
-
var _bbox2 = this.cache.layoutData.bbox;
|
|
14880
|
-
return this._AABBBounds.set(_bbox2.xOffset, _bbox2.yOffset, _bbox2.xOffset + _bbox2.width, _bbox2.yOffset + _bbox2.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14752
|
+
_attribute$wordBreak2 = attribute.wordBreak;
|
|
14753
|
+
_attribute$wordBreak2 === void 0 ? textTheme.wordBreak : _attribute$wordBreak2;
|
|
14754
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
14755
|
+
var _bbox = this.cache.layoutData.bbox;
|
|
14756
|
+
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14881
14757
|
}
|
|
14882
14758
|
var textMeasure = application.graphicUtil.textMeasure,
|
|
14883
14759
|
layoutData = new CanvasTextLayout(fontFamily, {
|
|
@@ -14911,11 +14787,12 @@
|
|
|
14911
14787
|
fontWeight = _attribute$fontWeight4 === void 0 ? textTheme.fontWeight : _attribute$fontWeight4,
|
|
14912
14788
|
_attribute$stroke4 = attribute.stroke,
|
|
14913
14789
|
stroke = _attribute$stroke4 === void 0 ? textTheme.stroke : _attribute$stroke4,
|
|
14790
|
+
_attribute$lineHeight4 = attribute.lineHeight,
|
|
14791
|
+
lineHeight = _attribute$lineHeight4 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight4,
|
|
14914
14792
|
_attribute$lineWidth4 = attribute.lineWidth,
|
|
14915
14793
|
lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
|
|
14916
14794
|
_attribute$verticalMo2 = attribute.verticalMode,
|
|
14917
|
-
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2
|
|
14918
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
14795
|
+
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2;
|
|
14919
14796
|
var _attribute$textAlign4 = attribute.textAlign,
|
|
14920
14797
|
textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
|
|
14921
14798
|
_attribute$textBaseli4 = attribute.textBaseline,
|
|
@@ -15048,7 +14925,7 @@
|
|
|
15048
14925
|
}, {
|
|
15049
14926
|
key: "updateMultilineAABBBounds",
|
|
15050
14927
|
value: function updateMultilineAABBBounds(text) {
|
|
15051
|
-
var _a, _b, _c
|
|
14928
|
+
var _a, _b, _c;
|
|
15052
14929
|
var textTheme = getTheme(this).text,
|
|
15053
14930
|
_this$attribute = this.attribute,
|
|
15054
14931
|
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
@@ -15059,6 +14936,8 @@
|
|
|
15059
14936
|
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
15060
14937
|
_this$attribute$fontS = _this$attribute.fontSize,
|
|
15061
14938
|
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
14939
|
+
_this$attribute$lineH = _this$attribute.lineHeight,
|
|
14940
|
+
lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
|
|
15062
14941
|
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
15063
14942
|
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
15064
14943
|
maxLineWidth = _this$attribute.maxLineWidth,
|
|
@@ -15075,9 +14954,8 @@
|
|
|
15075
14954
|
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
15076
14955
|
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
15077
14956
|
lineClamp = _this$attribute.lineClamp,
|
|
15078
|
-
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
15079
14957
|
buf = ignoreBuf ? 0 : 2;
|
|
15080
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
14958
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
15081
14959
|
var _bbox = this.cache.layoutData.bbox;
|
|
15082
14960
|
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
15083
14961
|
}
|
|
@@ -15109,7 +14987,7 @@
|
|
|
15109
14987
|
if ("" !== str && "" === clip.str) {
|
|
15110
14988
|
if (ellipsis) {
|
|
15111
14989
|
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
15112
|
-
clip.str = null !== (
|
|
14990
|
+
clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
|
|
15113
14991
|
} else clip.str = "", clip.width = 0;
|
|
15114
14992
|
needCut = !1;
|
|
15115
14993
|
}
|
|
@@ -20351,7 +20229,7 @@
|
|
|
20351
20229
|
var t = textAlign;
|
|
20352
20230
|
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
20353
20231
|
}
|
|
20354
|
-
var lineHeight = null !== (_c =
|
|
20232
|
+
var lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
|
|
20355
20233
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
20356
20234
|
if (!data) return;
|
|
20357
20235
|
var fVisible = data.fVisible,
|
|
@@ -24962,11 +24840,6 @@
|
|
|
24962
24840
|
get: function get() {
|
|
24963
24841
|
return this.at(0);
|
|
24964
24842
|
}
|
|
24965
|
-
}, {
|
|
24966
|
-
key: "preventRender",
|
|
24967
|
-
value: function preventRender(prevent) {
|
|
24968
|
-
prevent ? this._skipRender = -1 / 0 : this.params && this.params.optimize && !1 !== this.params.optimize.skipRenderWithOutRange ? this._skipRender = this.window.isVisible() ? 0 : 1 : this._skipRender = 0;
|
|
24969
|
-
}
|
|
24970
24843
|
}, {
|
|
24971
24844
|
key: "optmize",
|
|
24972
24845
|
value: function optmize(params) {
|
|
@@ -24977,8 +24850,8 @@
|
|
|
24977
24850
|
value: function optmizeRender() {
|
|
24978
24851
|
var _this2 = this;
|
|
24979
24852
|
var skipRenderWithOutRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
24980
|
-
skipRenderWithOutRange && (this._skipRender = this.
|
|
24981
|
-
|
|
24853
|
+
skipRenderWithOutRange && (this._skipRender = this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(function (visible) {
|
|
24854
|
+
visible ? (_this2.dirtyBounds && _this2.dirtyBounds.setValue(0, 0, _this2._viewBox.width(), _this2._viewBox.height()), _this2._skipRender > 1 && _this2.renderNextFrame(), _this2._skipRender = 0) : _this2._skipRender = 1;
|
|
24982
24855
|
}));
|
|
24983
24856
|
}
|
|
24984
24857
|
}, {
|
|
@@ -33454,13 +33327,6 @@
|
|
|
33454
33327
|
_context.globalAlpha = strokeOpacity * opacity, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
33455
33328
|
}
|
|
33456
33329
|
}
|
|
33457
|
-
}, {
|
|
33458
|
-
key: "measureText",
|
|
33459
|
-
value: function measureText(text) {
|
|
33460
|
-
var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
33461
|
-
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
33462
|
-
return _get(_getPrototypeOf(LynxContext2d.prototype), "measureText", this).call(this, text, method);
|
|
33463
|
-
}
|
|
33464
33330
|
}, {
|
|
33465
33331
|
key: "createPattern",
|
|
33466
33332
|
value: function createPattern(image, repetition) {
|
|
@@ -34627,7 +34493,7 @@
|
|
|
34627
34493
|
|
|
34628
34494
|
var roughModule = _roughModule;
|
|
34629
34495
|
|
|
34630
|
-
const version = "0.16.14-alpha.
|
|
34496
|
+
const version = "0.16.14-alpha.4";
|
|
34631
34497
|
loadAllModule(container);
|
|
34632
34498
|
|
|
34633
34499
|
exports.ACustomAnimate = ACustomAnimate;
|
|
@@ -34860,7 +34726,6 @@
|
|
|
34860
34726
|
exports.builtinSymbols = builtinSymbols;
|
|
34861
34727
|
exports.builtinSymbolsMap = builtinSymbolsMap;
|
|
34862
34728
|
exports.calcLineCache = calcLineCache$1;
|
|
34863
|
-
exports.calculateLineHeight = calculateLineHeight;
|
|
34864
34729
|
exports.centroidOfSubpath = centroidOfSubpath;
|
|
34865
34730
|
exports.circleBounds = circleBounds;
|
|
34866
34731
|
exports.clock = clock;
|