@visactor/vrender-components 1.0.46-alpha.0 → 1.0.46-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/axis/base.js +1 -1
- package/cjs/axis/circle.js +1 -1
- package/cjs/axis/config.js +1 -1
- package/cjs/axis/constant.js +1 -1
- package/cjs/axis/index.js +1 -1
- package/cjs/axis/line.js +1 -1
- package/cjs/axis/register.js +1 -1
- package/cjs/axis/type.js +1 -1
- package/cjs/axis/util.js +1 -1
- package/cjs/brush/config.js +1 -2
- package/cjs/core/type.js +2 -1
- package/cjs/crosshair/rect.js +1 -2
- package/cjs/data-zoom/index.js +1 -1
- package/cjs/data-zoom/interaction.js +1 -2
- package/cjs/data-zoom/register.js +1 -1
- package/cjs/data-zoom/renderer.js +1 -1
- package/cjs/data-zoom/type.js +1 -1
- package/cjs/data-zoom/utils.js +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/indicator/index.js +2 -1
- package/cjs/label/base.js +1 -1
- package/cjs/label/data-label-register.js +1 -1
- package/cjs/label/dataLabel.js +1 -1
- package/cjs/label/index.js +1 -1
- package/cjs/label/line.js +1 -1
- package/cjs/label/polygon.js +1 -1
- package/cjs/label/rect.js +1 -1
- package/cjs/label/register.js +1 -1
- package/cjs/label/symbol.js +1 -1
- package/cjs/label/type.js +2 -1
- package/cjs/label/util.js +1 -1
- package/cjs/label-item/index.js +1 -1
- package/cjs/label-item/label-item.js +1 -1
- package/cjs/label-item/register.js +1 -1
- package/cjs/label-item/type.js +1 -1
- package/dist/index.es.js +496 -400
- package/es/axis/base.js +1 -1
- package/es/axis/circle.js +1 -1
- package/es/axis/config.js +1 -1
- package/es/axis/constant.js +1 -1
- package/es/axis/index.js +1 -1
- package/es/axis/line.js +1 -1
- package/es/axis/register.js +1 -1
- package/es/axis/type.js +1 -1
- package/es/axis/util.js +1 -1
- package/es/brush/config.js +1 -2
- package/es/core/type.js +2 -1
- package/es/crosshair/rect.js +1 -2
- package/es/data-zoom/index.js +1 -1
- package/es/data-zoom/interaction.js +1 -2
- package/es/data-zoom/register.js +1 -1
- package/es/data-zoom/renderer.js +1 -1
- package/es/data-zoom/type.js +1 -1
- package/es/data-zoom/utils.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/indicator/index.js +2 -1
- package/es/label/base.js +1 -1
- package/es/label/data-label-register.js +1 -1
- package/es/label/dataLabel.js +1 -1
- package/es/label/index.js +1 -1
- package/es/label/line.js +1 -1
- package/es/label/polygon.js +1 -1
- package/es/label/rect.js +1 -1
- package/es/label/register.js +1 -1
- package/es/label/symbol.js +1 -1
- package/es/label/type.js +2 -1
- package/es/label/util.js +1 -1
- package/es/label-item/index.js +1 -1
- package/es/label-item/label-item.js +1 -1
- package/es/label-item/register.js +1 -1
- package/es/label-item/type.js +1 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
|
@@ -499,20 +499,14 @@ class ContributionProviderCache {
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
function bindContributionProvider(bind, id) {
|
|
502
|
-
bind(ContributionProvider).toDynamicValue(
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
} = _ref;
|
|
506
|
-
return new ContributionProviderCache(id, container);
|
|
507
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
502
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
503
|
+
container: container
|
|
504
|
+
}) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
|
|
508
505
|
}
|
|
509
506
|
function bindContributionProviderNoSingletonScope(bind, id) {
|
|
510
|
-
bind(ContributionProvider).toDynamicValue(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
} = _ref2;
|
|
514
|
-
return new ContributionProviderCache(id, container);
|
|
515
|
-
}).whenTargetNamed(id);
|
|
507
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
508
|
+
container: container
|
|
509
|
+
}) => new ContributionProviderCache(id, container)).whenTargetNamed(id);
|
|
516
510
|
}
|
|
517
511
|
class ContributionStore {
|
|
518
512
|
static getStore(id) {
|
|
@@ -582,10 +576,7 @@ class Hook {
|
|
|
582
576
|
}
|
|
583
577
|
|
|
584
578
|
class SyncHook extends Hook {
|
|
585
|
-
call() {
|
|
586
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
587
|
-
args[_key] = arguments[_key];
|
|
588
|
-
}
|
|
579
|
+
call(...args) {
|
|
589
580
|
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
590
581
|
}
|
|
591
582
|
}
|
|
@@ -900,16 +891,13 @@ let DefaultGlobal = class extends EventListenerManager {
|
|
|
900
891
|
updateDom(dom, params) {
|
|
901
892
|
return this._env || this.setEnv("browser"), this.envContribution.updateDom(dom, params);
|
|
902
893
|
}
|
|
903
|
-
getElementTop(dom) {
|
|
904
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
894
|
+
getElementTop(dom, baseWindow = !1) {
|
|
905
895
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTop(dom, baseWindow);
|
|
906
896
|
}
|
|
907
|
-
getElementLeft(dom) {
|
|
908
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
897
|
+
getElementLeft(dom, baseWindow = !1) {
|
|
909
898
|
return this._env || this.setEnv("browser"), this.envContribution.getElementLeft(dom, baseWindow);
|
|
910
899
|
}
|
|
911
|
-
getElementTopLeft(dom) {
|
|
912
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
900
|
+
getElementTopLeft(dom, baseWindow = !1) {
|
|
913
901
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTopLeft(dom, baseWindow);
|
|
914
902
|
}
|
|
915
903
|
isMacOS() {
|
|
@@ -994,7 +982,7 @@ class BoundsContext {
|
|
|
994
982
|
clear() {
|
|
995
983
|
this.bounds.clear();
|
|
996
984
|
}
|
|
997
|
-
release() {}
|
|
985
|
+
release(...params) {}
|
|
998
986
|
}
|
|
999
987
|
|
|
1000
988
|
class CurvePath {
|
|
@@ -1169,8 +1157,7 @@ function drawArc(context, x, y, coords) {
|
|
|
1169
1157
|
context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
|
|
1170
1158
|
}
|
|
1171
1159
|
}
|
|
1172
|
-
const addArcToBezierPath =
|
|
1173
|
-
let counterclockwise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
|
|
1160
|
+
const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, counterclockwise = !1) => {
|
|
1174
1161
|
const PI2 = 2 * Math.PI,
|
|
1175
1162
|
sAngle = (startAngle % PI2 + PI2) % PI2;
|
|
1176
1163
|
let deltaAngle,
|
|
@@ -1198,12 +1185,7 @@ const addArcToBezierPath = function (bezierPath, startAngle, endAngle, cx, cy, r
|
|
|
1198
1185
|
};
|
|
1199
1186
|
|
|
1200
1187
|
const commandFuncs = [(command, context, x, y, sx, sy, z) => context.arc(command[1] * sx + x, command[2] * sy + y, command[3] * (sx + sy) / 2, command[4], command[5], command[6], z), (command, context, x, y, sx, sy, z) => context.arcTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * (sx + sy) / 2, z), (command, context, x, y, sx, sy, z) => context.bezierCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * sx + x, command[6] * sy + y, z), (command, context, x, y) => context.closePath(), (command, context, x, y, sx, sy) => context.ellipse(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, command[5], command[6], command[7], command[8]), (command, context, x, y, sx, sy, z) => context.lineTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.moveTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.quadraticCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, z), (command, context, x, y, sx, sy, z) => context.rect(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, z)];
|
|
1201
|
-
function renderCommandList(commandList, context) {
|
|
1202
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1203
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1204
|
-
let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
1205
|
-
let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
1206
|
-
let z = arguments.length > 6 ? arguments[6] : undefined;
|
|
1188
|
+
function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
|
|
1207
1189
|
for (let i = 0; i < commandList.length; i++) {
|
|
1208
1190
|
const command = commandList[i];
|
|
1209
1191
|
commandFuncs[command[0]](command, context, x, y, sx, sy, z);
|
|
@@ -1444,7 +1426,7 @@ class ReflectSegContext extends SegContext {
|
|
|
1444
1426
|
}
|
|
1445
1427
|
}
|
|
1446
1428
|
|
|
1447
|
-
function genCurveSegments(path, points) {
|
|
1429
|
+
function genCurveSegments(path, points, step = 1) {
|
|
1448
1430
|
let defined0 = !1;
|
|
1449
1431
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
1450
1432
|
}
|
|
@@ -1487,8 +1469,7 @@ class Linear {
|
|
|
1487
1469
|
return this.context.tryUpdateLength();
|
|
1488
1470
|
}
|
|
1489
1471
|
}
|
|
1490
|
-
function genLinearSegments(points) {
|
|
1491
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1472
|
+
function genLinearSegments(points, params = {}) {
|
|
1492
1473
|
const {
|
|
1493
1474
|
direction: direction,
|
|
1494
1475
|
startPoint: startPoint
|
|
@@ -1498,7 +1479,7 @@ function genLinearSegments(points) {
|
|
|
1498
1479
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
1499
1480
|
}
|
|
1500
1481
|
function genLinearTypeSegments(path, points) {
|
|
1501
|
-
return genCurveSegments(path, points);
|
|
1482
|
+
return genCurveSegments(path, points, 1);
|
|
1502
1483
|
}
|
|
1503
1484
|
|
|
1504
1485
|
function point$3(curveClass, x, y, defined, p) {
|
|
@@ -1541,10 +1522,9 @@ class Basis {
|
|
|
1541
1522
|
}
|
|
1542
1523
|
}
|
|
1543
1524
|
function genBasisTypeSegments(path, points) {
|
|
1544
|
-
return genCurveSegments(path, points);
|
|
1525
|
+
return genCurveSegments(path, points, 2);
|
|
1545
1526
|
}
|
|
1546
|
-
function genBasisSegments(points) {
|
|
1547
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1527
|
+
function genBasisSegments(points, params = {}) {
|
|
1548
1528
|
const {
|
|
1549
1529
|
direction: direction,
|
|
1550
1530
|
startPoint: startPoint
|
|
@@ -1637,10 +1617,9 @@ class MonotoneY extends MonotoneX {
|
|
|
1637
1617
|
}
|
|
1638
1618
|
}
|
|
1639
1619
|
function genMonotoneXTypeSegments(path, points) {
|
|
1640
|
-
return genCurveSegments(path, points);
|
|
1620
|
+
return genCurveSegments(path, points, 2);
|
|
1641
1621
|
}
|
|
1642
|
-
function genMonotoneXSegments(points) {
|
|
1643
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1622
|
+
function genMonotoneXSegments(points, params = {}) {
|
|
1644
1623
|
const {
|
|
1645
1624
|
direction: direction,
|
|
1646
1625
|
startPoint: startPoint
|
|
@@ -1651,10 +1630,9 @@ function genMonotoneXSegments(points) {
|
|
|
1651
1630
|
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
1652
1631
|
}
|
|
1653
1632
|
function genMonotoneYTypeSegments(path, points) {
|
|
1654
|
-
return genCurveSegments(path, points);
|
|
1633
|
+
return genCurveSegments(path, points, 2);
|
|
1655
1634
|
}
|
|
1656
|
-
function genMonotoneYSegments(points) {
|
|
1657
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1635
|
+
function genMonotoneYSegments(points, params = {}) {
|
|
1658
1636
|
const {
|
|
1659
1637
|
direction: direction,
|
|
1660
1638
|
startPoint: startPoint
|
|
@@ -1666,9 +1644,7 @@ function genMonotoneYSegments(points) {
|
|
|
1666
1644
|
}
|
|
1667
1645
|
|
|
1668
1646
|
let Step$1 = class Step {
|
|
1669
|
-
constructor(context) {
|
|
1670
|
-
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
1671
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
1647
|
+
constructor(context, t = .5, startPoint) {
|
|
1672
1648
|
this.context = context, this._t = t, this.startPoint = startPoint;
|
|
1673
1649
|
}
|
|
1674
1650
|
areaStart() {
|
|
@@ -1709,8 +1685,7 @@ class StepClosed extends Step$1 {
|
|
|
1709
1685
|
this.context.closePath();
|
|
1710
1686
|
}
|
|
1711
1687
|
}
|
|
1712
|
-
function genStepSegments(points, t) {
|
|
1713
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1688
|
+
function genStepSegments(points, t, params = {}) {
|
|
1714
1689
|
const {
|
|
1715
1690
|
direction: direction,
|
|
1716
1691
|
startPoint: startPoint
|
|
@@ -1720,10 +1695,9 @@ function genStepSegments(points, t) {
|
|
|
1720
1695
|
return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
|
|
1721
1696
|
}
|
|
1722
1697
|
function genStepTypeSegments(path, points) {
|
|
1723
|
-
return genCurveSegments(path, points);
|
|
1698
|
+
return genCurveSegments(path, points, 1);
|
|
1724
1699
|
}
|
|
1725
|
-
function genStepClosedSegments(points, t) {
|
|
1726
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1700
|
+
function genStepClosedSegments(points, t, params = {}) {
|
|
1727
1701
|
const {
|
|
1728
1702
|
direction: direction,
|
|
1729
1703
|
startPoint: startPoint
|
|
@@ -1738,8 +1712,7 @@ class LinearClosed extends Linear {
|
|
|
1738
1712
|
this.context.closePath();
|
|
1739
1713
|
}
|
|
1740
1714
|
}
|
|
1741
|
-
function genLinearClosedSegments(points) {
|
|
1742
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1715
|
+
function genLinearClosedSegments(points, params = {}) {
|
|
1743
1716
|
const {
|
|
1744
1717
|
direction: direction,
|
|
1745
1718
|
startPoint: startPoint
|
|
@@ -1749,7 +1722,7 @@ function genLinearClosedSegments(points) {
|
|
|
1749
1722
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
1750
1723
|
}
|
|
1751
1724
|
function genLinearClosedTypeSegments(path, points) {
|
|
1752
|
-
return genCurveSegments(path, points);
|
|
1725
|
+
return genCurveSegments(path, points, 1);
|
|
1753
1726
|
}
|
|
1754
1727
|
|
|
1755
1728
|
function point$1(curveClass, x, y, defined, p) {
|
|
@@ -1770,9 +1743,7 @@ function point$1(curveClass, x, y, defined, p) {
|
|
|
1770
1743
|
curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
|
|
1771
1744
|
}
|
|
1772
1745
|
class CatmullRom {
|
|
1773
|
-
constructor(context) {
|
|
1774
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
1775
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
1746
|
+
constructor(context, alpha = .5, startPoint) {
|
|
1776
1747
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
1777
1748
|
}
|
|
1778
1749
|
areaStart() {
|
|
@@ -1826,8 +1797,7 @@ class CatmullRom {
|
|
|
1826
1797
|
}
|
|
1827
1798
|
}
|
|
1828
1799
|
function commonGenCatmullRomSegments(type, cons) {
|
|
1829
|
-
return function (points, alpha) {
|
|
1830
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1800
|
+
return function (points, alpha, params = {}) {
|
|
1831
1801
|
const {
|
|
1832
1802
|
direction: direction,
|
|
1833
1803
|
startPoint: startPoint
|
|
@@ -1836,15 +1806,13 @@ function commonGenCatmullRomSegments(type, cons) {
|
|
|
1836
1806
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
1837
1807
|
const segContext = genSegContext(type, direction, points),
|
|
1838
1808
|
gatmullRom = new cons(segContext, alpha, startPoint);
|
|
1839
|
-
return genCurveSegments(gatmullRom, points), segContext;
|
|
1809
|
+
return genCurveSegments(gatmullRom, points, 2), segContext;
|
|
1840
1810
|
};
|
|
1841
1811
|
}
|
|
1842
1812
|
const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
|
|
1843
1813
|
|
|
1844
1814
|
class CatmullRomClosed {
|
|
1845
|
-
constructor(context) {
|
|
1846
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
1847
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
1815
|
+
constructor(context, alpha = .5, startPoint) {
|
|
1848
1816
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
1849
1817
|
}
|
|
1850
1818
|
areaStart() {
|
|
@@ -2154,11 +2122,7 @@ class CustomPath2D extends CurvePath {
|
|
|
2154
2122
|
cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
|
|
2155
2123
|
}
|
|
2156
2124
|
closePathTransform() {}
|
|
2157
|
-
_runCommandStrList(commandStrList) {
|
|
2158
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2159
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2160
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2161
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
2125
|
+
_runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
2162
2126
|
let current,
|
|
2163
2127
|
tempX,
|
|
2164
2128
|
tempY,
|
|
@@ -2232,11 +2196,7 @@ class CustomPath2D extends CurvePath {
|
|
|
2232
2196
|
previous = current;
|
|
2233
2197
|
}
|
|
2234
2198
|
}
|
|
2235
|
-
_runCommandList(commandList) {
|
|
2236
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2237
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2238
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2239
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
2199
|
+
_runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
2240
2200
|
if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
|
|
2241
2201
|
const current = commandList[i].slice();
|
|
2242
2202
|
switch (current[0]) {
|
|
@@ -2434,7 +2394,9 @@ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
|
2434
2394
|
background: null,
|
|
2435
2395
|
autoAnimateTexture: !1,
|
|
2436
2396
|
textureRatio: 1,
|
|
2437
|
-
textureOptions:
|
|
2397
|
+
textureOptions: {
|
|
2398
|
+
alignToGraphic: !0
|
|
2399
|
+
},
|
|
2438
2400
|
backgroundOpacity: 1,
|
|
2439
2401
|
backgroundCornerRadius: 0,
|
|
2440
2402
|
texture: null,
|
|
@@ -2448,6 +2410,7 @@ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
|
2448
2410
|
backgroundScale: 1,
|
|
2449
2411
|
backgroundOffsetX: 0,
|
|
2450
2412
|
backgroundOffsetY: 0,
|
|
2413
|
+
backgroundPosition: "top-left",
|
|
2451
2414
|
blur: 0,
|
|
2452
2415
|
filter: "",
|
|
2453
2416
|
cursor: null,
|
|
@@ -2620,11 +2583,16 @@ const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, D
|
|
|
2620
2583
|
const DefaultImageAttribute = Object.assign(Object.assign({
|
|
2621
2584
|
repeatX: "no-repeat",
|
|
2622
2585
|
repeatY: "no-repeat",
|
|
2586
|
+
imageMode: void 0,
|
|
2623
2587
|
image: "",
|
|
2624
2588
|
width: 0,
|
|
2625
2589
|
height: 0,
|
|
2626
2590
|
maxWidth: 500,
|
|
2627
|
-
maxHeight: 500
|
|
2591
|
+
maxHeight: 500,
|
|
2592
|
+
imagePosition: "top-left",
|
|
2593
|
+
imageScale: 1,
|
|
2594
|
+
imageOffsetX: 0,
|
|
2595
|
+
imageOffsetY: 0
|
|
2628
2596
|
}, DefaultAttribute), {
|
|
2629
2597
|
fill: !0,
|
|
2630
2598
|
cornerRadius: 0,
|
|
@@ -2908,9 +2876,7 @@ function getScaledStroke(context, width, dpr) {
|
|
|
2908
2876
|
scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
|
|
2909
2877
|
return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
|
|
2910
2878
|
}
|
|
2911
|
-
function createColor(context, c, params) {
|
|
2912
|
-
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2913
|
-
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2879
|
+
function createColor(context, c, params, offsetX = 0, offsetY = 0) {
|
|
2914
2880
|
var _a, _b, _c, _d;
|
|
2915
2881
|
if (!c || !0 === c) return "black";
|
|
2916
2882
|
let result, color;
|
|
@@ -3049,8 +3015,7 @@ function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter)
|
|
|
3049
3015
|
}
|
|
3050
3016
|
return needTestLetter && (index = testLetter(desc, index)), index;
|
|
3051
3017
|
}
|
|
3052
|
-
function testLetter(string, index) {
|
|
3053
|
-
let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
3018
|
+
function testLetter(string, index, negativeWrongMatch = !1) {
|
|
3054
3019
|
let i = index;
|
|
3055
3020
|
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
|
|
3056
3021
|
return i;
|
|
@@ -3060,8 +3025,7 @@ function testLetter2(string, index) {
|
|
|
3060
3025
|
for (; regLetter.test(string[i + 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
|
|
3061
3026
|
return i + 1;
|
|
3062
3027
|
}
|
|
3063
|
-
function measureTextCanvas(text, character) {
|
|
3064
|
-
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
3028
|
+
function measureTextCanvas(text, character, mode = "actual") {
|
|
3065
3029
|
var _a;
|
|
3066
3030
|
if ("" === text) return {
|
|
3067
3031
|
ascent: 0,
|
|
@@ -3134,10 +3098,9 @@ let ATextMeasure = class {
|
|
|
3134
3098
|
}
|
|
3135
3099
|
return metrics;
|
|
3136
3100
|
}
|
|
3137
|
-
estimate(text,
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
} = _ref;
|
|
3101
|
+
estimate(text, {
|
|
3102
|
+
fontSize = DefaultTextAttribute.fontSize
|
|
3103
|
+
}) {
|
|
3141
3104
|
let eCharLen = 0,
|
|
3142
3105
|
cCharLen = 0;
|
|
3143
3106
|
for (let i = 0; i < text.length; i++) text.charCodeAt(i) < 128 ? eCharLen++ : cCharLen++;
|
|
@@ -3448,8 +3411,7 @@ let ATextMeasure = class {
|
|
|
3448
3411
|
});
|
|
3449
3412
|
});
|
|
3450
3413
|
}
|
|
3451
|
-
clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
|
|
3452
|
-
let forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
3414
|
+
clipTextWithSuffix(text, options, width, suffix, wordBreak, position, forceSuffix = !1) {
|
|
3453
3415
|
if ("" === suffix) return this.clipText(text, options, width, wordBreak);
|
|
3454
3416
|
if (0 === text.length) return {
|
|
3455
3417
|
str: "",
|
|
@@ -3895,7 +3857,7 @@ class DefaultCanvasAllocate {
|
|
|
3895
3857
|
get length() {
|
|
3896
3858
|
return this.pools.length;
|
|
3897
3859
|
}
|
|
3898
|
-
release() {
|
|
3860
|
+
release(...params) {
|
|
3899
3861
|
this.pools = [];
|
|
3900
3862
|
}
|
|
3901
3863
|
}
|
|
@@ -4095,8 +4057,7 @@ let DefaultGraphicUtil = class {
|
|
|
4095
4057
|
bindTextMeasure(tm) {
|
|
4096
4058
|
this._textMeasure && "DefaultTextMeasureContribution" !== tm.id || (this._textMeasure = tm), this._textMeasureMap.has(tm.id) || this._textMeasureMap.set(tm.id, tm);
|
|
4097
4059
|
}
|
|
4098
|
-
measureText(text, tc) {
|
|
4099
|
-
let method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "native";
|
|
4060
|
+
measureText(text, tc, method = "native") {
|
|
4100
4061
|
var _a;
|
|
4101
4062
|
this.configure(this.global, this.global.env);
|
|
4102
4063
|
const m = this.global.measureTextMethod;
|
|
@@ -4279,8 +4240,7 @@ class Theme {
|
|
|
4279
4240
|
for (; group.parent;) if ((group = group.parent).theme) return group;
|
|
4280
4241
|
return null;
|
|
4281
4242
|
}
|
|
4282
|
-
applyTheme(group, pt) {
|
|
4283
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
4243
|
+
applyTheme(group, pt, force = !1) {
|
|
4284
4244
|
if (this.dirty) {
|
|
4285
4245
|
const parentGroup = this.getParentWithTheme(group);
|
|
4286
4246
|
if (parentGroup) {
|
|
@@ -4379,8 +4339,7 @@ class Node extends EventEmitter {
|
|
|
4379
4339
|
constructor() {
|
|
4380
4340
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
4381
4341
|
}
|
|
4382
|
-
forEachChildren(cb) {
|
|
4383
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4342
|
+
forEachChildren(cb, reverse = !1) {
|
|
4384
4343
|
if (reverse) {
|
|
4385
4344
|
let child = this._lastChild,
|
|
4386
4345
|
i = 0;
|
|
@@ -4397,8 +4356,7 @@ class Node extends EventEmitter {
|
|
|
4397
4356
|
}
|
|
4398
4357
|
}
|
|
4399
4358
|
}
|
|
4400
|
-
forEachChildrenAsync(cb) {
|
|
4401
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4359
|
+
forEachChildrenAsync(cb, reverse = !1) {
|
|
4402
4360
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
4403
4361
|
if (reverse) {
|
|
4404
4362
|
let child = this._lastChild,
|
|
@@ -4422,13 +4380,12 @@ class Node extends EventEmitter {
|
|
|
4422
4380
|
forEach(cb) {
|
|
4423
4381
|
return this.forEachChildren(cb);
|
|
4424
4382
|
}
|
|
4425
|
-
appendChild(node) {
|
|
4426
|
-
let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
4383
|
+
appendChild(node, highPerformance = !0) {
|
|
4427
4384
|
if (this._uid === node._uid) return null;
|
|
4428
4385
|
if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
|
|
4429
4386
|
return node.parent && node.parent.removeChild(node), node.parent = this, this._lastChild ? (this._lastChild._next = node, node._prev = this._lastChild, this._lastChild = node) : (this._firstChild = this._lastChild = node, node._prev = node._next = null), this._idMap || (this._idMap = new Map()), this._idMap.set(node._uid, node), this.setCount(node.count), this._structEdit = !0, node;
|
|
4430
4387
|
}
|
|
4431
|
-
appendChildArrHighPerformance(nodes) {
|
|
4388
|
+
appendChildArrHighPerformance(nodes, replace = !1) {
|
|
4432
4389
|
return console.error("暂不支持该函数"), nodes;
|
|
4433
4390
|
}
|
|
4434
4391
|
insertBefore(newNode, referenceNode) {
|
|
@@ -4496,8 +4453,7 @@ class Node extends EventEmitter {
|
|
|
4496
4453
|
replaceChild(newChild, oldChild) {
|
|
4497
4454
|
throw new Error("暂不支持");
|
|
4498
4455
|
}
|
|
4499
|
-
find(callback) {
|
|
4500
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4456
|
+
find(callback, deep = !1) {
|
|
4501
4457
|
let target = null;
|
|
4502
4458
|
return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
|
|
4503
4459
|
if (child.isContainer) {
|
|
@@ -4507,8 +4463,7 @@ class Node extends EventEmitter {
|
|
|
4507
4463
|
return !1;
|
|
4508
4464
|
}), target;
|
|
4509
4465
|
}
|
|
4510
|
-
findAll(callback) {
|
|
4511
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4466
|
+
findAll(callback, deep = !1) {
|
|
4512
4467
|
let nodes = [];
|
|
4513
4468
|
return this.forEachChildren((node, index) => {
|
|
4514
4469
|
node !== this && callback(node, index) && nodes.push(node);
|
|
@@ -4537,8 +4492,7 @@ class Node extends EventEmitter {
|
|
|
4537
4492
|
getElementsByType(type) {
|
|
4538
4493
|
return this.findAll(node => node.type === type, !0);
|
|
4539
4494
|
}
|
|
4540
|
-
getChildByName(name) {
|
|
4541
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4495
|
+
getChildByName(name, deep = !1) {
|
|
4542
4496
|
return this.find(node => node.name === name, deep);
|
|
4543
4497
|
}
|
|
4544
4498
|
getChildAt(idx) {
|
|
@@ -4657,10 +4611,7 @@ class Node extends EventEmitter {
|
|
|
4657
4611
|
removeAllListeners() {
|
|
4658
4612
|
return this.removeAllEventListeners();
|
|
4659
4613
|
}
|
|
4660
|
-
dispatchEvent(event) {
|
|
4661
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
4662
|
-
args[_key - 1] = arguments[_key];
|
|
4663
|
-
}
|
|
4614
|
+
dispatchEvent(event, ...args) {
|
|
4664
4615
|
return super.emit(event.type, event, ...args), !event.defaultPrevented;
|
|
4665
4616
|
}
|
|
4666
4617
|
emit(event, data) {
|
|
@@ -5055,8 +5006,7 @@ class SquareSymbol extends BaseSymbol {
|
|
|
5055
5006
|
}
|
|
5056
5007
|
var square$1 = new SquareSymbol();
|
|
5057
5008
|
|
|
5058
|
-
function trianglUpOffset(ctx, r, x, y) {
|
|
5059
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
5009
|
+
function trianglUpOffset(ctx, r, x, y, offset = 0) {
|
|
5060
5010
|
return ctx.moveTo(x + r + 2 * offset, r + y + offset), ctx.lineTo(x - r - 2 * offset, r + y + offset), ctx.lineTo(x, y - r - 2 * offset), ctx.closePath(), !0;
|
|
5061
5011
|
}
|
|
5062
5012
|
class TriangleUpSymbol extends BaseSymbol {
|
|
@@ -5202,8 +5152,7 @@ class TriangleLeftSymbol extends BaseSymbol {
|
|
|
5202
5152
|
}
|
|
5203
5153
|
var triangleLeft = new TriangleLeftSymbol();
|
|
5204
5154
|
|
|
5205
|
-
function trianglRightOffset(ctx, r, x, y) {
|
|
5206
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
5155
|
+
function trianglRightOffset(ctx, r, x, y, offset = 0) {
|
|
5207
5156
|
return ctx.moveTo(x - r - offset, r + y + 2 * offset), ctx.lineTo(r + x + 2 * offset, y), ctx.lineTo(x - r - offset, y - r - 2 * offset), ctx.closePath(), !0;
|
|
5208
5157
|
}
|
|
5209
5158
|
class TriangleRightSymbol extends BaseSymbol {
|
|
@@ -5219,8 +5168,7 @@ class TriangleRightSymbol extends BaseSymbol {
|
|
|
5219
5168
|
}
|
|
5220
5169
|
var triangleRight = new TriangleRightSymbol();
|
|
5221
5170
|
|
|
5222
|
-
function trianglDownOffset(ctx, r, x, y) {
|
|
5223
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
5171
|
+
function trianglDownOffset(ctx, r, x, y, offset = 0) {
|
|
5224
5172
|
return ctx.moveTo(x - r - 2 * offset, y - r - offset), ctx.lineTo(x + r + 2 * offset, y - r - offset), ctx.lineTo(x, y + r + 2 * offset), ctx.closePath(), !0;
|
|
5225
5173
|
}
|
|
5226
5174
|
class TriangleDownSymbol extends BaseSymbol {
|
|
@@ -5437,8 +5385,7 @@ var rect = new RectSymbol();
|
|
|
5437
5385
|
|
|
5438
5386
|
const tempBounds = new AABBBounds();
|
|
5439
5387
|
class CustomSymbolClass {
|
|
5440
|
-
constructor(type, path) {
|
|
5441
|
-
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
5388
|
+
constructor(type, path, isSvg = !1) {
|
|
5442
5389
|
this.pathStr = "", this.type = type, isArray(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
5443
5390
|
}
|
|
5444
5391
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
@@ -5460,10 +5407,9 @@ class CustomSymbolClass {
|
|
|
5460
5407
|
bounds(size, bounds) {
|
|
5461
5408
|
if (size = this.parseSize(size), this.isSvg) {
|
|
5462
5409
|
if (!this.svgCache) return;
|
|
5463
|
-
return bounds.clear(), void this.svgCache.forEach(
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
} = _ref;
|
|
5410
|
+
return bounds.clear(), void this.svgCache.forEach(({
|
|
5411
|
+
path: path
|
|
5412
|
+
}) => {
|
|
5467
5413
|
tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
|
|
5468
5414
|
});
|
|
5469
5415
|
}
|
|
@@ -5519,8 +5465,7 @@ function findClosingIndex(xmlData, str, i, errMsg) {
|
|
|
5519
5465
|
if (-1 === closingIndex) throw new Error(errMsg);
|
|
5520
5466
|
return closingIndex + str.length - 1;
|
|
5521
5467
|
}
|
|
5522
|
-
function tagExpWithClosingIndex(xmlData, i) {
|
|
5523
|
-
let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
|
|
5468
|
+
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
5524
5469
|
let attrBoundary,
|
|
5525
5470
|
tagExp = "";
|
|
5526
5471
|
for (let index = i; index < xmlData.length; index++) {
|
|
@@ -5538,8 +5483,7 @@ function tagExpWithClosingIndex(xmlData, i) {
|
|
|
5538
5483
|
tagExp += ch;
|
|
5539
5484
|
}
|
|
5540
5485
|
}
|
|
5541
|
-
function readTagExp(xmlData, i, removeNSPrefix) {
|
|
5542
|
-
let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
|
|
5486
|
+
function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
5543
5487
|
const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
|
|
5544
5488
|
if (!result) return;
|
|
5545
5489
|
let tagExp = result.data;
|
|
@@ -5701,8 +5645,7 @@ undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator)
|
|
|
5701
5645
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5702
5646
|
});
|
|
5703
5647
|
};
|
|
5704
|
-
function boundStroke(bounds, halfW, miter) {
|
|
5705
|
-
let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5648
|
+
function boundStroke(bounds, halfW, miter, pad = 0) {
|
|
5706
5649
|
return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
|
|
5707
5650
|
}
|
|
5708
5651
|
function miterAdjustment(miter, strokeWidth) {
|
|
@@ -5887,7 +5830,7 @@ class DefaultMatrixAllocate {
|
|
|
5887
5830
|
get length() {
|
|
5888
5831
|
return this.pools.length;
|
|
5889
5832
|
}
|
|
5890
|
-
release() {
|
|
5833
|
+
release(...params) {
|
|
5891
5834
|
this.pools = [];
|
|
5892
5835
|
}
|
|
5893
5836
|
}
|
|
@@ -5915,7 +5858,7 @@ class DefaultMat4Allocate {
|
|
|
5915
5858
|
get length() {
|
|
5916
5859
|
return this.pools.length;
|
|
5917
5860
|
}
|
|
5918
|
-
release() {
|
|
5861
|
+
release(...params) {
|
|
5919
5862
|
this.pools = [];
|
|
5920
5863
|
}
|
|
5921
5864
|
}
|
|
@@ -5950,8 +5893,7 @@ let EmptyContext2d = class {
|
|
|
5950
5893
|
getContext() {
|
|
5951
5894
|
throw new Error("不支持getContext");
|
|
5952
5895
|
}
|
|
5953
|
-
setTransformForCurrent() {
|
|
5954
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
5896
|
+
setTransformForCurrent(force = !1) {
|
|
5955
5897
|
!force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
|
|
5956
5898
|
}
|
|
5957
5899
|
get currentMatrix() {
|
|
@@ -5972,8 +5914,7 @@ let EmptyContext2d = class {
|
|
|
5972
5914
|
highPerformanceRestore() {
|
|
5973
5915
|
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
5974
5916
|
}
|
|
5975
|
-
rotate(rad) {
|
|
5976
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
5917
|
+
rotate(rad, setTransform = !0) {
|
|
5977
5918
|
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
5978
5919
|
}
|
|
5979
5920
|
save() {
|
|
@@ -5984,55 +5925,41 @@ let EmptyContext2d = class {
|
|
|
5984
5925
|
const matrix = this.cloneMatrix(this.matrix);
|
|
5985
5926
|
this.stack.push(matrix);
|
|
5986
5927
|
}
|
|
5987
|
-
scale(sx, sy) {
|
|
5988
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
5928
|
+
scale(sx, sy, setTransform = !0) {
|
|
5989
5929
|
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
5990
5930
|
}
|
|
5991
|
-
setScale(sx, sy) {
|
|
5992
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
5931
|
+
setScale(sx, sy, setTransform = !0) {
|
|
5993
5932
|
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
5994
5933
|
}
|
|
5995
|
-
scalePoint(sx, sy, px, py) {
|
|
5996
|
-
let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
5934
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
5997
5935
|
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
|
|
5998
5936
|
}
|
|
5999
|
-
setTransform(a, b, c, d, e, f) {
|
|
6000
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
6001
|
-
let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
|
|
5937
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
6002
5938
|
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
6003
5939
|
}
|
|
6004
|
-
setTransformFromMatrix(matrix) {
|
|
6005
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
6006
|
-
let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
|
|
5940
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
6007
5941
|
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
|
|
6008
5942
|
}
|
|
6009
|
-
resetTransform() {
|
|
6010
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
6011
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
5943
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
6012
5944
|
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
6013
5945
|
}
|
|
6014
|
-
transform(a, b, c, d, e, f) {
|
|
6015
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
5946
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
6016
5947
|
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
6017
5948
|
}
|
|
6018
5949
|
transformFromMatrix(matrix, setTransform) {
|
|
6019
5950
|
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
|
|
6020
5951
|
}
|
|
6021
|
-
translate(x, y) {
|
|
6022
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
5952
|
+
translate(x, y, setTransform = !0) {
|
|
6023
5953
|
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
6024
5954
|
}
|
|
6025
|
-
rotateDegrees(deg) {
|
|
6026
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
5955
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
6027
5956
|
const rad = deg * Math.PI / 180;
|
|
6028
5957
|
this.rotate(rad, setTransform);
|
|
6029
5958
|
}
|
|
6030
|
-
rotateAbout(rad, x, y) {
|
|
6031
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
5959
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
6032
5960
|
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
6033
5961
|
}
|
|
6034
|
-
rotateDegreesAbout(deg, x, y) {
|
|
6035
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
5962
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
6036
5963
|
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
6037
5964
|
}
|
|
6038
5965
|
beginPath() {
|
|
@@ -6126,19 +6053,16 @@ let EmptyContext2d = class {
|
|
|
6126
6053
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {}
|
|
6127
6054
|
setTextStyle(params, defaultParams) {}
|
|
6128
6055
|
draw() {}
|
|
6129
|
-
clearMatrix() {
|
|
6130
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
6131
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
6056
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
6132
6057
|
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
6133
6058
|
}
|
|
6134
6059
|
setClearMatrix(a, b, c, d, e, f) {
|
|
6135
6060
|
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
6136
6061
|
}
|
|
6137
|
-
onlyTranslate() {
|
|
6138
|
-
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
6062
|
+
onlyTranslate(dpr = this.dpr) {
|
|
6139
6063
|
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
6140
6064
|
}
|
|
6141
|
-
release() {
|
|
6065
|
+
release(...params) {
|
|
6142
6066
|
this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
|
|
6143
6067
|
}
|
|
6144
6068
|
};
|
|
@@ -6149,9 +6073,7 @@ var ColorType;
|
|
|
6149
6073
|
ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
|
|
6150
6074
|
}(ColorType || (ColorType = {}));
|
|
6151
6075
|
class ColorStore {
|
|
6152
|
-
static Get(str) {
|
|
6153
|
-
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
|
|
6154
|
-
let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
|
|
6076
|
+
static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
|
|
6155
6077
|
if (size === ColorType.Color1) {
|
|
6156
6078
|
const color = ColorStore.store1[str];
|
|
6157
6079
|
if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
|
|
@@ -6179,8 +6101,7 @@ class ColorStore {
|
|
|
6179
6101
|
}
|
|
6180
6102
|
ColorStore.store255 = {}, ColorStore.store1 = {};
|
|
6181
6103
|
|
|
6182
|
-
function colorArrayToString(color) {
|
|
6183
|
-
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6104
|
+
function colorArrayToString(color, alphaChannel = !1) {
|
|
6184
6105
|
return Array.isArray(color) && isNumber(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
|
|
6185
6106
|
}
|
|
6186
6107
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
@@ -6365,8 +6286,7 @@ class Graphic extends Node {
|
|
|
6365
6286
|
get globalTransMatrix() {
|
|
6366
6287
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
6367
6288
|
}
|
|
6368
|
-
constructor() {
|
|
6369
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6289
|
+
constructor(params = {}) {
|
|
6370
6290
|
var _a;
|
|
6371
6291
|
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
6372
6292
|
}
|
|
@@ -6386,8 +6306,7 @@ class Graphic extends Node {
|
|
|
6386
6306
|
set2dMode() {
|
|
6387
6307
|
this.in3dMode = !1;
|
|
6388
6308
|
}
|
|
6389
|
-
getOffsetXY(attr) {
|
|
6390
|
-
let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6309
|
+
getOffsetXY(attr, includeScroll = !1) {
|
|
6391
6310
|
var _a, _b;
|
|
6392
6311
|
const {
|
|
6393
6312
|
dx = attr.dx,
|
|
@@ -6498,7 +6417,7 @@ class Graphic extends Node {
|
|
|
6498
6417
|
const b = this.AABBBounds;
|
|
6499
6418
|
return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this._globalAABBBounds.empty() || this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
|
|
6500
6419
|
}
|
|
6501
|
-
tryUpdateGlobalTransMatrix() {
|
|
6420
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
6502
6421
|
if (this._globalTransMatrix) {
|
|
6503
6422
|
if (this.parent) {
|
|
6504
6423
|
const m = this.parent.globalTransMatrix;
|
|
@@ -6510,8 +6429,7 @@ class Graphic extends Node {
|
|
|
6510
6429
|
shouldUpdateGlobalMatrix() {
|
|
6511
6430
|
return !0;
|
|
6512
6431
|
}
|
|
6513
|
-
tryUpdateLocalTransMatrix() {
|
|
6514
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
6432
|
+
tryUpdateLocalTransMatrix(clearTag = !0) {
|
|
6515
6433
|
return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
|
|
6516
6434
|
}
|
|
6517
6435
|
shouldUpdateAABBBounds() {
|
|
@@ -6551,24 +6469,17 @@ class Graphic extends Node {
|
|
|
6551
6469
|
setWidthHeightWithoutTransform(aabbBounds) {
|
|
6552
6470
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
6553
6471
|
}
|
|
6554
|
-
setAttributesAndPreventAnimate(params) {
|
|
6555
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6556
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
6557
|
-
let ignorePriority = arguments.length > 3 ? arguments[3] : undefined;
|
|
6472
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
|
|
6558
6473
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
6559
6474
|
(animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
|
|
6560
6475
|
animate.preventAttr(key);
|
|
6561
6476
|
});
|
|
6562
6477
|
});
|
|
6563
6478
|
}
|
|
6564
|
-
setAttributes(params) {
|
|
6565
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6566
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
6479
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
6567
6480
|
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
|
|
6568
6481
|
}
|
|
6569
|
-
_setAttributes(params) {
|
|
6570
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6571
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
6482
|
+
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
6572
6483
|
const keys = Object.keys(params);
|
|
6573
6484
|
for (let i = 0; i < keys.length; i++) {
|
|
6574
6485
|
const key = keys[i];
|
|
@@ -6583,16 +6494,14 @@ class Graphic extends Node {
|
|
|
6583
6494
|
}, this.attribute, key, context);
|
|
6584
6495
|
params ? this._setAttributes(params, forceUpdateTag, context) : isNil(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
6585
6496
|
}
|
|
6586
|
-
needUpdateTags(keys) {
|
|
6587
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
6497
|
+
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
6588
6498
|
for (let i = 0; i < k.length; i++) {
|
|
6589
6499
|
const attrKey = k[i];
|
|
6590
6500
|
if (-1 !== keys.indexOf(attrKey)) return !0;
|
|
6591
6501
|
}
|
|
6592
6502
|
return !1;
|
|
6593
6503
|
}
|
|
6594
|
-
needUpdateTag(key) {
|
|
6595
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
6504
|
+
needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
6596
6505
|
for (let i = 0; i < k.length; i++) {
|
|
6597
6506
|
if (key === k[i]) return !0;
|
|
6598
6507
|
}
|
|
@@ -6748,8 +6657,7 @@ class Graphic extends Node {
|
|
|
6748
6657
|
newNormalAttrs[key] = this.getNormalAttribute(key);
|
|
6749
6658
|
}), this.normalAttrs = newNormalAttrs;
|
|
6750
6659
|
}
|
|
6751
|
-
stopStateAnimates() {
|
|
6752
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
|
|
6660
|
+
stopStateAnimates(type = "end") {
|
|
6753
6661
|
this.animates && this.animates.forEach(animate => {
|
|
6754
6662
|
animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
|
|
6755
6663
|
});
|
|
@@ -6914,8 +6822,7 @@ class Graphic extends Node {
|
|
|
6914
6822
|
var _a;
|
|
6915
6823
|
return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
|
|
6916
6824
|
}
|
|
6917
|
-
onSetStage(cb) {
|
|
6918
|
-
let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6825
|
+
onSetStage(cb, immediate = !1) {
|
|
6919
6826
|
this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
|
|
6920
6827
|
}
|
|
6921
6828
|
attachShadow(shadowRoot) {
|
|
@@ -6936,9 +6843,9 @@ class Graphic extends Node {
|
|
|
6936
6843
|
createPathProxy(path) {
|
|
6937
6844
|
return isString(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
6938
6845
|
}
|
|
6939
|
-
loadImage(image) {
|
|
6940
|
-
|
|
6941
|
-
if (!image
|
|
6846
|
+
loadImage(image, background = !1) {
|
|
6847
|
+
if (background && (null == image ? void 0 : image.background) && (image = image.background), background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
|
|
6848
|
+
if (!image) return;
|
|
6942
6849
|
const url = image;
|
|
6943
6850
|
this.resources || (this.resources = new Map());
|
|
6944
6851
|
const cache = {
|
|
@@ -6967,8 +6874,7 @@ class Graphic extends Node {
|
|
|
6967
6874
|
animate.stop();
|
|
6968
6875
|
});
|
|
6969
6876
|
}
|
|
6970
|
-
stopAnimates() {
|
|
6971
|
-
let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
6877
|
+
stopAnimates(stopChildren = !1) {
|
|
6972
6878
|
this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
|
|
6973
6879
|
c.stopAnimates(stopChildren);
|
|
6974
6880
|
});
|
|
@@ -6994,7 +6900,7 @@ class Graphic extends Node {
|
|
|
6994
6900
|
}
|
|
6995
6901
|
}
|
|
6996
6902
|
function backgroundNotImage(image) {
|
|
6997
|
-
return !(!image.fill && !image.stroke);
|
|
6903
|
+
return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl(image) || image.includes("/") || isBase64(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
|
|
6998
6904
|
}
|
|
6999
6905
|
function isExternalTexture(texture) {
|
|
7000
6906
|
return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl(texture) || texture.includes("/") || isBase64(texture)) : isObject(texture));
|
|
@@ -7119,8 +7025,7 @@ class Group extends Graphic {
|
|
|
7119
7025
|
_updateChildToStage(child) {
|
|
7120
7026
|
return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
|
|
7121
7027
|
}
|
|
7122
|
-
appendChild(node) {
|
|
7123
|
-
let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
7028
|
+
appendChild(node, addStage = !0) {
|
|
7124
7029
|
const data = super.appendChild(node);
|
|
7125
7030
|
return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
|
|
7126
7031
|
}
|
|
@@ -7137,8 +7042,7 @@ class Group extends Graphic {
|
|
|
7137
7042
|
const data = super.removeChild(child);
|
|
7138
7043
|
return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
|
|
7139
7044
|
}
|
|
7140
|
-
removeAllChild() {
|
|
7141
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
7045
|
+
removeAllChild(deep = !1) {
|
|
7142
7046
|
this.forEachChildren(child => {
|
|
7143
7047
|
this.getGraphicService().onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
7144
7048
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
@@ -7158,8 +7062,7 @@ class Group extends Graphic {
|
|
|
7158
7062
|
g.isContainer && g.addUpdateGlobalPositionTag();
|
|
7159
7063
|
});
|
|
7160
7064
|
}
|
|
7161
|
-
tryUpdateGlobalTransMatrix() {
|
|
7162
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
7065
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
7163
7066
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
7164
7067
|
if (this._globalTransMatrix) {
|
|
7165
7068
|
if (this.parent) {
|
|
@@ -7233,8 +7136,7 @@ class Layer extends Group {
|
|
|
7233
7136
|
zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
|
|
7234
7137
|
}), this.layer = this, this.subLayers = new Map(), this.theme = new Theme(), this.background = "rgba(0, 0, 0, 0)", this.afterDrawCbs = [];
|
|
7235
7138
|
}
|
|
7236
|
-
combineSubLayer() {
|
|
7237
|
-
let removeIncrementalKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
7139
|
+
combineSubLayer(removeIncrementalKey = !0) {
|
|
7238
7140
|
const subLayers = Array.from(this.subLayers.values()).sort((a, b) => a.zIndex - b.zIndex);
|
|
7239
7141
|
this.layerHandler.merge(subLayers.map(l => (l.layer.subLayers.size && l.layer.combineSubLayer(removeIncrementalKey), l.layer.getNativeHandler()))), removeIncrementalKey && subLayers.forEach(l => {
|
|
7240
7142
|
l.group && (l.group.incremental = 0);
|
|
@@ -7343,10 +7245,9 @@ let DefaultLayerService = DefaultLayerService_1 = class {
|
|
|
7343
7245
|
let layerHandler;
|
|
7344
7246
|
return layerHandler = "static" === layerMode ? container.get(StaticLayerHandlerContribution) : "dynamic" === layerMode ? container.get(DynamicLayerHandlerContribution) : container.get(VirtualLayerHandlerContribution), layerHandler;
|
|
7345
7247
|
}
|
|
7346
|
-
createLayer(stage
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
};
|
|
7248
|
+
createLayer(stage, options = {
|
|
7249
|
+
main: !1
|
|
7250
|
+
}) {
|
|
7350
7251
|
var _a;
|
|
7351
7252
|
this.tryInit();
|
|
7352
7253
|
let layerMode = this.getRecommendedLayerType(options.layerMode);
|
|
@@ -7587,8 +7488,7 @@ const InteractiveSubRenderContribution = Symbol.for("InteractiveSubRenderContrib
|
|
|
7587
7488
|
function textDrawOffsetX(textAlign, width) {
|
|
7588
7489
|
return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
|
|
7589
7490
|
}
|
|
7590
|
-
function textLayoutOffsetY(baseline, lineHeight, fontSize) {
|
|
7591
|
-
let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
7491
|
+
function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
|
|
7592
7492
|
return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
|
|
7593
7493
|
}
|
|
7594
7494
|
|
|
@@ -7802,10 +7702,9 @@ const updateBoundsOfCommonOuterBorder = (attribute, theme, aabbBounds) => {
|
|
|
7802
7702
|
|
|
7803
7703
|
const CIRCLE_UPDATE_TAG_KEY = ["radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
7804
7704
|
class Circle extends Graphic {
|
|
7805
|
-
constructor(
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
};
|
|
7705
|
+
constructor(params = {
|
|
7706
|
+
radius: 1
|
|
7707
|
+
}) {
|
|
7809
7708
|
super(params), this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
7810
7709
|
}
|
|
7811
7710
|
isValid() {
|
|
@@ -7887,10 +7786,7 @@ class CanvasTextLayout {
|
|
|
7887
7786
|
} else bbox.yOffset = -bbox.height;
|
|
7888
7787
|
return bbox;
|
|
7889
7788
|
}
|
|
7890
|
-
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
7891
|
-
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
7892
|
-
let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
7893
|
-
let params = arguments.length > 6 ? arguments[6] : undefined;
|
|
7789
|
+
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
|
|
7894
7790
|
const {
|
|
7895
7791
|
lineWidth: lineWidth,
|
|
7896
7792
|
suffixPosition = "end",
|
|
@@ -8013,11 +7909,10 @@ class Text extends Graphic {
|
|
|
8013
7909
|
get isMultiLine() {
|
|
8014
7910
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
8015
7911
|
}
|
|
8016
|
-
constructor(
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
};
|
|
7912
|
+
constructor(params = {
|
|
7913
|
+
text: "",
|
|
7914
|
+
fontSize: 16
|
|
7915
|
+
}) {
|
|
8021
7916
|
super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
|
|
8022
7917
|
}
|
|
8023
7918
|
isValid() {
|
|
@@ -8349,12 +8244,10 @@ class Text extends Graphic {
|
|
|
8349
8244
|
var _a;
|
|
8350
8245
|
return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
8351
8246
|
}
|
|
8352
|
-
needUpdateTags(keys) {
|
|
8353
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
8247
|
+
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
8354
8248
|
return super.needUpdateTags(keys, k);
|
|
8355
8249
|
}
|
|
8356
|
-
needUpdateTag(key) {
|
|
8357
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
8250
|
+
needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
|
|
8358
8251
|
return super.needUpdateTag(key, k);
|
|
8359
8252
|
}
|
|
8360
8253
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
@@ -8557,19 +8450,15 @@ const updateBoundsOfSymbolOuterBorder = (attribute, symbolTheme, aabbBounds) =>
|
|
|
8557
8450
|
|
|
8558
8451
|
const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
8559
8452
|
let Symbol$1 = class Symbol extends Graphic {
|
|
8560
|
-
constructor(
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
};
|
|
8453
|
+
constructor(params = {
|
|
8454
|
+
symbolType: "circle"
|
|
8455
|
+
}) {
|
|
8564
8456
|
super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
8565
8457
|
}
|
|
8566
8458
|
getParsedPath() {
|
|
8567
8459
|
return this.shouldUpdateShape() && (this._parsedPath = this.doUpdateParsedPath(), this.clearUpdateShapeTag()), this._parsedPath;
|
|
8568
8460
|
}
|
|
8569
|
-
getParsedPath2D() {
|
|
8570
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8571
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8572
|
-
let size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
8461
|
+
getParsedPath2D(x = 0, y = 0, size = 1) {
|
|
8573
8462
|
let path = null;
|
|
8574
8463
|
try {
|
|
8575
8464
|
path = new Path2D();
|
|
@@ -8656,8 +8545,7 @@ function createSymbol(attributes) {
|
|
|
8656
8545
|
|
|
8657
8546
|
const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
8658
8547
|
let Line$1 = class Line extends Graphic {
|
|
8659
|
-
constructor() {
|
|
8660
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8548
|
+
constructor(params = {}) {
|
|
8661
8549
|
super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
8662
8550
|
}
|
|
8663
8551
|
isValid() {
|
|
@@ -9109,7 +8997,7 @@ function seperateParagraph(paragraph, index) {
|
|
|
9109
8997
|
return [new Paragraph(text1, paragraph.newLine, paragraph.character, paragraph.ascentDescentMode), new Paragraph(text2, !0, paragraph.character, paragraph.ascentDescentMode)];
|
|
9110
8998
|
}
|
|
9111
8999
|
|
|
9112
|
-
const IMAGE_UPDATE_TAG_KEY = ["width", "height", "image", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
9000
|
+
const IMAGE_UPDATE_TAG_KEY = ["width", "height", "image", "imageMode", "imagePosition", "imageScale", "imageOffsetX", "imageOffsetY", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
9113
9001
|
class Image extends Graphic {
|
|
9114
9002
|
constructor(params) {
|
|
9115
9003
|
super(params), this.type = "image", this.numberType = IMAGE_NUMBER_TYPE, this.loadImage(this.attribute.image);
|
|
@@ -9214,6 +9102,7 @@ class Image extends Graphic {
|
|
|
9214
9102
|
}
|
|
9215
9103
|
Image.NOWORK_ANIMATE_ATTR = Object.assign({
|
|
9216
9104
|
image: 1,
|
|
9105
|
+
imageMode: 1,
|
|
9217
9106
|
repeatX: 1,
|
|
9218
9107
|
repeatY: 1
|
|
9219
9108
|
}, NOWORK_ANIMATE_ATTR);
|
|
@@ -9395,8 +9284,7 @@ class Wrapper {
|
|
|
9395
9284
|
line = new Line(this.frame.left, this[this.directionKey.width], this.y + maxAscent, maxAscent, maxDescent, this.lineBuffer, this.direction, "horizontal" === this.direction ? this.frame.isWidthMax : this.frame.isHeightMax);
|
|
9396
9285
|
this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
|
|
9397
9286
|
}
|
|
9398
|
-
deal(paragraph) {
|
|
9399
|
-
let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
9287
|
+
deal(paragraph, singleLine = !1) {
|
|
9400
9288
|
paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), (0 !== paragraph.text.length || this.newLine) && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
|
|
9401
9289
|
}
|
|
9402
9290
|
cut(paragraph, singleLine) {
|
|
@@ -10252,11 +10140,12 @@ class DefaultBaseBackgroundRenderContribution {
|
|
|
10252
10140
|
backgroundScale = graphicAttribute.backgroundScale,
|
|
10253
10141
|
backgroundOffsetX = graphicAttribute.backgroundOffsetX,
|
|
10254
10142
|
backgroundOffsetY = graphicAttribute.backgroundOffsetY,
|
|
10255
|
-
backgroundClip = graphicAttribute.backgroundClip
|
|
10143
|
+
backgroundClip = graphicAttribute.backgroundClip,
|
|
10144
|
+
backgroundPosition = graphicAttribute.backgroundPosition
|
|
10256
10145
|
} = graphic.attribute;
|
|
10257
10146
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
10258
|
-
const res = graphic.resources.get(background);
|
|
10259
|
-
if ("success" !== res.state || !res.data) return;
|
|
10147
|
+
const res = graphic.resources.get(getBackgroundImage(background));
|
|
10148
|
+
if (!res || "success" !== res.state || !res.data) return;
|
|
10260
10149
|
if (context.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
10261
10150
|
const groupAttribute = getTheme(graphic.parent).group,
|
|
10262
10151
|
{
|
|
@@ -10273,59 +10162,160 @@ class DefaultBaseBackgroundRenderContribution {
|
|
|
10273
10162
|
backgroundKeepAspectRatio: backgroundKeepAspectRatio,
|
|
10274
10163
|
backgroundScale: backgroundScale,
|
|
10275
10164
|
backgroundOffsetX: backgroundOffsetX,
|
|
10276
|
-
backgroundOffsetY: backgroundOffsetY
|
|
10165
|
+
backgroundOffsetY: backgroundOffsetY,
|
|
10166
|
+
backgroundPosition: backgroundPosition
|
|
10277
10167
|
}), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
10278
10168
|
} else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity * opacity, context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
10279
10169
|
}
|
|
10280
10170
|
doDrawImage(context, data, b, params) {
|
|
10281
|
-
|
|
10282
|
-
backgroundMode: backgroundMode,
|
|
10283
|
-
backgroundFit: backgroundFit,
|
|
10284
|
-
backgroundKeepAspectRatio: backgroundKeepAspectRatio,
|
|
10285
|
-
backgroundScale = 1,
|
|
10286
|
-
backgroundOffsetX = 0,
|
|
10287
|
-
backgroundOffsetY = 0
|
|
10288
|
-
} = params,
|
|
10289
|
-
targetW = b.width(),
|
|
10290
|
-
targetH = b.height();
|
|
10291
|
-
let w = targetW,
|
|
10292
|
-
h = targetH;
|
|
10293
|
-
if ("no-repeat" === backgroundMode) {
|
|
10294
|
-
if (backgroundFit) {
|
|
10295
|
-
if (backgroundKeepAspectRatio) {
|
|
10296
|
-
const maxScale = Math.max(targetW / data.width, targetH / data.height);
|
|
10297
|
-
context.drawImage(data, b.x1 + backgroundOffsetX, b.y1 + backgroundOffsetY, data.width * maxScale * backgroundScale, data.height * maxScale * backgroundScale);
|
|
10298
|
-
} else context.drawImage(data, b.x1, b.y1, b.width(), b.height());
|
|
10299
|
-
} else {
|
|
10300
|
-
const resW = data.width * backgroundScale,
|
|
10301
|
-
resH = data.height * backgroundScale;
|
|
10302
|
-
context.drawImage(data, b.x1 + backgroundOffsetX, b.y1 + backgroundOffsetY, resW, resH);
|
|
10303
|
-
}
|
|
10304
|
-
} else {
|
|
10305
|
-
if (backgroundFit && "repeat" !== backgroundMode && (data.width || data.height)) {
|
|
10306
|
-
const resW = data.width,
|
|
10307
|
-
resH = data.height;
|
|
10308
|
-
if ("repeat-x" === backgroundMode) {
|
|
10309
|
-
w = resW * (targetH / resH), h = targetH;
|
|
10310
|
-
} else if ("repeat-y" === backgroundMode) {
|
|
10311
|
-
h = resH * (targetW / resW), w = targetW;
|
|
10312
|
-
}
|
|
10313
|
-
const dpr = context.dpr,
|
|
10314
|
-
canvas = canvasAllocate.allocate({
|
|
10315
|
-
width: w,
|
|
10316
|
-
height: h,
|
|
10317
|
-
dpr: dpr
|
|
10318
|
-
}),
|
|
10319
|
-
ctx = canvas.getContext("2d");
|
|
10320
|
-
ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), canvasAllocate.free(canvas);
|
|
10321
|
-
}
|
|
10322
|
-
const dpr = context.dpr,
|
|
10323
|
-
pattern = context.createPattern(data, backgroundMode);
|
|
10324
|
-
pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, 0, 0])), context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
|
|
10325
|
-
}
|
|
10171
|
+
drawBackgroundImage(context, data, b, params);
|
|
10326
10172
|
}
|
|
10327
10173
|
}
|
|
10328
10174
|
const defaultBaseBackgroundRenderContribution = new DefaultBaseBackgroundRenderContribution();
|
|
10175
|
+
const verticalPositionKeywords = new Set(["top", "center", "bottom"]);
|
|
10176
|
+
function getBackgroundImage(background) {
|
|
10177
|
+
var _a;
|
|
10178
|
+
return null !== (_a = null == background ? void 0 : background.background) && void 0 !== _a ? _a : background;
|
|
10179
|
+
}
|
|
10180
|
+
function resolveBackgroundSizing({
|
|
10181
|
+
backgroundFit: backgroundFit,
|
|
10182
|
+
backgroundKeepAspectRatio: backgroundKeepAspectRatio
|
|
10183
|
+
}) {
|
|
10184
|
+
return backgroundFit ? backgroundKeepAspectRatio ? "cover" : "fill" : "auto";
|
|
10185
|
+
}
|
|
10186
|
+
const NO_REPEAT_SIZING_MAP = {
|
|
10187
|
+
"no-repeat-cover": "cover",
|
|
10188
|
+
"no-repeat-contain": "contain",
|
|
10189
|
+
"no-repeat-fill": "fill",
|
|
10190
|
+
"no-repeat-auto": "auto"
|
|
10191
|
+
};
|
|
10192
|
+
function resolveBackgroundDrawMode({
|
|
10193
|
+
backgroundMode: backgroundMode,
|
|
10194
|
+
backgroundFit: backgroundFit,
|
|
10195
|
+
backgroundKeepAspectRatio: backgroundKeepAspectRatio
|
|
10196
|
+
}) {
|
|
10197
|
+
const sizing = NO_REPEAT_SIZING_MAP[backgroundMode];
|
|
10198
|
+
return sizing ? {
|
|
10199
|
+
backgroundRepeatMode: "no-repeat",
|
|
10200
|
+
backgroundSizing: sizing
|
|
10201
|
+
} : {
|
|
10202
|
+
backgroundRepeatMode: backgroundMode,
|
|
10203
|
+
backgroundSizing: resolveBackgroundSizing({
|
|
10204
|
+
backgroundFit: backgroundFit,
|
|
10205
|
+
backgroundKeepAspectRatio: backgroundKeepAspectRatio
|
|
10206
|
+
})
|
|
10207
|
+
};
|
|
10208
|
+
}
|
|
10209
|
+
function isPercentageValue(value) {
|
|
10210
|
+
return /^-?\d+(\.\d+)?%$/.test(value);
|
|
10211
|
+
}
|
|
10212
|
+
function parsePositionToken(value, remainSpace, startKeyword, centerKeyword, endKeyword) {
|
|
10213
|
+
if ("number" == typeof value && Number.isFinite(value)) return value;
|
|
10214
|
+
const normalizedValue = `${null != value ? value : ""}`.trim().toLowerCase();
|
|
10215
|
+
if (!normalizedValue || normalizedValue === startKeyword) return 0;
|
|
10216
|
+
if (normalizedValue === centerKeyword) return remainSpace / 2;
|
|
10217
|
+
if (normalizedValue === endKeyword) return remainSpace;
|
|
10218
|
+
if (isPercentageValue(normalizedValue)) return remainSpace * parseFloat(normalizedValue) / 100;
|
|
10219
|
+
const parsedValue = Number(normalizedValue);
|
|
10220
|
+
return Number.isFinite(parsedValue) ? parsedValue : 0;
|
|
10221
|
+
}
|
|
10222
|
+
function normalizeBackgroundPosition(position) {
|
|
10223
|
+
var _a, _b;
|
|
10224
|
+
if (Array.isArray(position)) return [null !== (_a = position[0]) && void 0 !== _a ? _a : "left", null !== (_b = position[1]) && void 0 !== _b ? _b : "top"];
|
|
10225
|
+
const tokens = `${null != position ? position : "top-left"}`.trim().toLowerCase().replace(/-/g, " ").split(/\s+/).filter(Boolean);
|
|
10226
|
+
if (0 === tokens.length) return ["left", "top"];
|
|
10227
|
+
if (1 === tokens.length) {
|
|
10228
|
+
const token = tokens[0];
|
|
10229
|
+
return "center" === token ? ["center", "center"] : verticalPositionKeywords.has(token) ? ["center", token] : [token, "center"];
|
|
10230
|
+
}
|
|
10231
|
+
let horizontal, vertical;
|
|
10232
|
+
const genericTokens = [];
|
|
10233
|
+
for (let i = 0; i < 2; i++) {
|
|
10234
|
+
const token = tokens[i];
|
|
10235
|
+
"left" !== token && "right" !== token ? "top" !== token && "bottom" !== token ? genericTokens.push(token) : vertical = token : horizontal = token;
|
|
10236
|
+
}
|
|
10237
|
+
return null == horizontal && genericTokens.length && (horizontal = genericTokens.shift()), null == vertical && genericTokens.length && (vertical = genericTokens.shift()), [null != horizontal ? horizontal : "left", null != vertical ? vertical : "top"];
|
|
10238
|
+
}
|
|
10239
|
+
function resolveBackgroundPosition(position, remainWidth, remainHeight) {
|
|
10240
|
+
const [horizontalPosition, verticalPosition] = normalizeBackgroundPosition(position);
|
|
10241
|
+
return {
|
|
10242
|
+
x: parsePositionToken(horizontalPosition, remainWidth, "left", "center", "right"),
|
|
10243
|
+
y: parsePositionToken(verticalPosition, remainHeight, "top", "center", "bottom")
|
|
10244
|
+
};
|
|
10245
|
+
}
|
|
10246
|
+
function pickRenderableDimension(...values) {
|
|
10247
|
+
for (const value of values) if ("number" == typeof value && Number.isFinite(value) && value > 0) return value;
|
|
10248
|
+
return null;
|
|
10249
|
+
}
|
|
10250
|
+
function resolveRenderableImageSize(data) {
|
|
10251
|
+
if (!data) return null;
|
|
10252
|
+
const width = pickRenderableDimension(data.naturalWidth, data.videoWidth, data.width),
|
|
10253
|
+
height = pickRenderableDimension(data.naturalHeight, data.videoHeight, data.height);
|
|
10254
|
+
return null == width || null == height ? null : {
|
|
10255
|
+
width: width,
|
|
10256
|
+
height: height
|
|
10257
|
+
};
|
|
10258
|
+
}
|
|
10259
|
+
function drawBackgroundImage(context, data, b, params) {
|
|
10260
|
+
var _a, _b;
|
|
10261
|
+
const {
|
|
10262
|
+
backgroundMode: backgroundMode,
|
|
10263
|
+
backgroundFit: backgroundFit,
|
|
10264
|
+
backgroundKeepAspectRatio: backgroundKeepAspectRatio,
|
|
10265
|
+
backgroundScale = 1,
|
|
10266
|
+
backgroundOffsetX = 0,
|
|
10267
|
+
backgroundOffsetY = 0,
|
|
10268
|
+
backgroundPosition = "top-left"
|
|
10269
|
+
} = params,
|
|
10270
|
+
targetW = b.width(),
|
|
10271
|
+
targetH = b.height(),
|
|
10272
|
+
sourceSize = resolveRenderableImageSize(data),
|
|
10273
|
+
{
|
|
10274
|
+
backgroundRepeatMode: backgroundRepeatMode,
|
|
10275
|
+
backgroundSizing: resolvedBackgroundSizing
|
|
10276
|
+
} = resolveBackgroundDrawMode({
|
|
10277
|
+
backgroundMode: backgroundMode,
|
|
10278
|
+
backgroundFit: backgroundFit,
|
|
10279
|
+
backgroundKeepAspectRatio: backgroundKeepAspectRatio
|
|
10280
|
+
});
|
|
10281
|
+
let w = targetW,
|
|
10282
|
+
h = targetH;
|
|
10283
|
+
if (targetW <= 0 || targetH <= 0) return;
|
|
10284
|
+
if ("no-repeat" === backgroundRepeatMode) {
|
|
10285
|
+
let drawWidth = null !== (_a = null == sourceSize ? void 0 : sourceSize.width) && void 0 !== _a ? _a : targetW,
|
|
10286
|
+
drawHeight = null !== (_b = null == sourceSize ? void 0 : sourceSize.height) && void 0 !== _b ? _b : targetH;
|
|
10287
|
+
if ("cover" !== resolvedBackgroundSizing && "contain" !== resolvedBackgroundSizing || !sourceSize) "fill" === resolvedBackgroundSizing && (drawWidth = targetW, drawHeight = targetH);else {
|
|
10288
|
+
const scale = "cover" === resolvedBackgroundSizing ? Math.max(targetW / sourceSize.width, targetH / sourceSize.height) : Math.min(targetW / sourceSize.width, targetH / sourceSize.height);
|
|
10289
|
+
drawWidth = sourceSize.width * scale, drawHeight = sourceSize.height * scale;
|
|
10290
|
+
}
|
|
10291
|
+
drawWidth *= backgroundScale, drawHeight *= backgroundScale;
|
|
10292
|
+
const {
|
|
10293
|
+
x: x,
|
|
10294
|
+
y: y
|
|
10295
|
+
} = resolveBackgroundPosition(backgroundPosition, targetW - drawWidth, targetH - drawHeight);
|
|
10296
|
+
return void context.drawImage(data, b.x1 + x + backgroundOffsetX, b.y1 + y + backgroundOffsetY, drawWidth, drawHeight);
|
|
10297
|
+
}
|
|
10298
|
+
if (backgroundFit && "repeat" !== backgroundRepeatMode && sourceSize) {
|
|
10299
|
+
const resW = sourceSize.width,
|
|
10300
|
+
resH = sourceSize.height;
|
|
10301
|
+
if ("repeat-x" === backgroundRepeatMode) {
|
|
10302
|
+
w = resW * (targetH / resH), h = targetH;
|
|
10303
|
+
} else if ("repeat-y" === backgroundRepeatMode) {
|
|
10304
|
+
h = resH * (targetW / resW), w = targetW;
|
|
10305
|
+
}
|
|
10306
|
+
const dpr = context.dpr,
|
|
10307
|
+
canvas = canvasAllocate.allocate({
|
|
10308
|
+
width: w,
|
|
10309
|
+
height: h,
|
|
10310
|
+
dpr: dpr
|
|
10311
|
+
}),
|
|
10312
|
+
ctx = canvas.getContext("2d");
|
|
10313
|
+
ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), canvasAllocate.free(canvas);
|
|
10314
|
+
}
|
|
10315
|
+
const dpr = context.dpr,
|
|
10316
|
+
pattern = context.createPattern(data, backgroundRepeatMode);
|
|
10317
|
+
pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, 0, 0])), context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
|
|
10318
|
+
}
|
|
10329
10319
|
let DefaultBaseInteractiveRenderContribution = class {
|
|
10330
10320
|
constructor(subRenderContribitions) {
|
|
10331
10321
|
this.subRenderContribitions = subRenderContribitions, this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
@@ -10484,7 +10474,7 @@ class DefaultBaseTextureRenderContribution {
|
|
|
10484
10474
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
10485
10475
|
}
|
|
10486
10476
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
10487
|
-
var _a;
|
|
10477
|
+
var _a, _b, _c, _d, _e;
|
|
10488
10478
|
const {
|
|
10489
10479
|
textureRatio = graphicAttribute.textureRatio,
|
|
10490
10480
|
textureOptions = null
|
|
@@ -10567,7 +10557,21 @@ class DefaultBaseTextureRenderContribution {
|
|
|
10567
10557
|
null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
|
|
10568
10558
|
}
|
|
10569
10559
|
useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
|
|
10570
|
-
} else if (pattern)
|
|
10560
|
+
} else if (pattern) {
|
|
10561
|
+
if (pattern.setTransform) {
|
|
10562
|
+
const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
|
|
10563
|
+
alignOffsetX = null !== (_b = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _b ? _b : 0,
|
|
10564
|
+
alignOffsetY = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _c ? _c : 0;
|
|
10565
|
+
let translateX = 0,
|
|
10566
|
+
translateY = 0;
|
|
10567
|
+
if (alignToGraphic) {
|
|
10568
|
+
const m = context.currentMatrix;
|
|
10569
|
+
translateX = (null !== (_d = null == m ? void 0 : m.e) && void 0 !== _d ? _d : 0) + x + alignOffsetX, translateY = (null !== (_e = null == m ? void 0 : m.f) && void 0 !== _e ? _e : 0) + y + alignOffsetY;
|
|
10570
|
+
} else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
|
|
10571
|
+
pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
|
|
10572
|
+
}
|
|
10573
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();
|
|
10574
|
+
} else if ("wave" === texture) {
|
|
10571
10575
|
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
10572
10576
|
const b = graphic.AABBBounds;
|
|
10573
10577
|
drawWave(context, textureRatio, b.width(), b.height(), Object.assign(Object.assign({}, textureOptions || {}), {
|
|
@@ -10697,35 +10701,38 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
10697
10701
|
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
10698
10702
|
const {
|
|
10699
10703
|
background: background,
|
|
10704
|
+
backgroundOpacity = graphicAttribute.backgroundOpacity,
|
|
10705
|
+
opacity = graphicAttribute.opacity,
|
|
10700
10706
|
backgroundMode = graphicAttribute.backgroundMode,
|
|
10701
10707
|
backgroundFit = graphicAttribute.backgroundFit,
|
|
10702
10708
|
backgroundKeepAspectRatio = graphicAttribute.backgroundKeepAspectRatio,
|
|
10703
10709
|
backgroundScale = graphicAttribute.backgroundScale,
|
|
10704
10710
|
backgroundOffsetX = graphicAttribute.backgroundOffsetX,
|
|
10705
|
-
backgroundOffsetY = graphicAttribute.backgroundOffsetY
|
|
10711
|
+
backgroundOffsetY = graphicAttribute.backgroundOffsetY,
|
|
10712
|
+
backgroundClip = graphicAttribute.backgroundClip,
|
|
10713
|
+
backgroundPosition = graphicAttribute.backgroundPosition
|
|
10706
10714
|
} = graphic.attribute;
|
|
10707
10715
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
10708
|
-
const res = graphic.resources.get(background);
|
|
10709
|
-
if ("success" !== res.state || !res.data) return;
|
|
10716
|
+
const res = graphic.resources.get(getBackgroundImage(background));
|
|
10717
|
+
if (!res || "success" !== res.state || !res.data) return;
|
|
10710
10718
|
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
|
|
10711
10719
|
const b = graphic.AABBBounds;
|
|
10712
|
-
this.doDrawImage(context, res.data, b, {
|
|
10720
|
+
context.globalAlpha = backgroundOpacity * opacity, backgroundClip && context.clip(), this.doDrawImage(context, res.data, b, {
|
|
10713
10721
|
backgroundMode: backgroundMode,
|
|
10714
10722
|
backgroundFit: backgroundFit,
|
|
10715
10723
|
backgroundKeepAspectRatio: backgroundKeepAspectRatio,
|
|
10716
10724
|
backgroundScale: backgroundScale,
|
|
10717
10725
|
backgroundOffsetX: backgroundOffsetX,
|
|
10718
|
-
backgroundOffsetY: backgroundOffsetY
|
|
10726
|
+
backgroundOffsetY: backgroundOffsetY,
|
|
10727
|
+
backgroundPosition: backgroundPosition
|
|
10719
10728
|
}), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
10720
|
-
} else context.highPerformanceSave(), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
10729
|
+
} else context.highPerformanceSave(), context.globalAlpha = backgroundOpacity * opacity, context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
10721
10730
|
}
|
|
10722
10731
|
}
|
|
10723
10732
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
10724
10733
|
|
|
10725
10734
|
const halfPi = pi / 2;
|
|
10726
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
10727
|
-
let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
10728
|
-
let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
|
|
10735
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
|
|
10729
10736
|
let cornerRadius;
|
|
10730
10737
|
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
10731
10738
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -11066,8 +11073,7 @@ class BaseRender {
|
|
|
11066
11073
|
doStroke: doStroke
|
|
11067
11074
|
};
|
|
11068
11075
|
}
|
|
11069
|
-
transform(graphic, graphicAttribute, context) {
|
|
11070
|
-
let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
11076
|
+
transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
|
|
11071
11077
|
const {
|
|
11072
11078
|
x = graphicAttribute.x,
|
|
11073
11079
|
y = graphicAttribute.y,
|
|
@@ -12190,7 +12196,7 @@ class DefaultBoundsAllocate {
|
|
|
12190
12196
|
get length() {
|
|
12191
12197
|
return this.pools.length;
|
|
12192
12198
|
}
|
|
12193
|
-
release() {
|
|
12199
|
+
release(...params) {
|
|
12194
12200
|
this.pools = [];
|
|
12195
12201
|
}
|
|
12196
12202
|
}
|
|
@@ -12203,9 +12209,17 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
12203
12209
|
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
12204
12210
|
var _a, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
12205
12211
|
const {
|
|
12212
|
+
backgroundOpacity = graphicAttribute.backgroundOpacity,
|
|
12213
|
+
opacity = graphicAttribute.opacity,
|
|
12206
12214
|
backgroundMode = graphicAttribute.backgroundMode,
|
|
12207
12215
|
backgroundFit = graphicAttribute.backgroundFit,
|
|
12208
|
-
backgroundKeepAspectRatio = graphicAttribute.backgroundKeepAspectRatio
|
|
12216
|
+
backgroundKeepAspectRatio = graphicAttribute.backgroundKeepAspectRatio,
|
|
12217
|
+
backgroundScale = graphicAttribute.backgroundScale,
|
|
12218
|
+
backgroundOffsetX = graphicAttribute.backgroundOffsetX,
|
|
12219
|
+
backgroundOffsetY = graphicAttribute.backgroundOffsetY,
|
|
12220
|
+
backgroundPosition = graphicAttribute.backgroundPosition,
|
|
12221
|
+
backgroundClip = graphicAttribute.backgroundClip,
|
|
12222
|
+
backgroundCornerRadius = graphicAttribute.backgroundCornerRadius
|
|
12209
12223
|
} = graphic.attribute;
|
|
12210
12224
|
let matrix,
|
|
12211
12225
|
{
|
|
@@ -12217,18 +12231,18 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
12217
12231
|
};
|
|
12218
12232
|
let b;
|
|
12219
12233
|
"richtext" === graphic.type && (matrix = context.currentMatrix.clone(), context.restore(), context.save(), context.setTransformForCurrent());
|
|
12220
|
-
const
|
|
12234
|
+
const backgroundConfig = isObject(background) && background.background ? background : null,
|
|
12221
12235
|
onlyTranslate = graphic.transMatrix.onlyTranslate();
|
|
12222
|
-
if (
|
|
12236
|
+
if (backgroundConfig) {
|
|
12223
12237
|
const _b = graphic.AABBBounds,
|
|
12224
|
-
x = (null !== (_a =
|
|
12225
|
-
y = (null !== (_d =
|
|
12226
|
-
w = null !== (_f =
|
|
12227
|
-
h = null !== (_g =
|
|
12228
|
-
if (b = boundsAllocate.allocate(x, y, x + w, y + h), background =
|
|
12238
|
+
x = (null !== (_a = backgroundConfig.x) && void 0 !== _a ? _a : _b.x1) + (null !== (_c = backgroundConfig.dx) && void 0 !== _c ? _c : 0),
|
|
12239
|
+
y = (null !== (_d = backgroundConfig.y) && void 0 !== _d ? _d : _b.y1) + (null !== (_e = backgroundConfig.dy) && void 0 !== _e ? _e : 0),
|
|
12240
|
+
w = null !== (_f = backgroundConfig.width) && void 0 !== _f ? _f : _b.width(),
|
|
12241
|
+
h = null !== (_g = backgroundConfig.height) && void 0 !== _g ? _g : _b.height();
|
|
12242
|
+
if (b = boundsAllocate.allocate(x, y, x + w, y + h), background = backgroundConfig.background, !onlyTranslate) {
|
|
12229
12243
|
const w = b.width(),
|
|
12230
12244
|
h = b.height();
|
|
12231
|
-
b.set((null !== (_h =
|
|
12245
|
+
b.set((null !== (_h = backgroundConfig.x) && void 0 !== _h ? _h : 0) + (null !== (_j = backgroundConfig.dx) && void 0 !== _j ? _j : 0), (null !== (_k = backgroundConfig.y) && void 0 !== _k ? _k : 0) + (null !== (_l = backgroundConfig.dy) && void 0 !== _l ? _l : 0), w, h);
|
|
12232
12246
|
}
|
|
12233
12247
|
} else b = graphic.AABBBounds, onlyTranslate || (b = getTextBounds(Object.assign(Object.assign({}, graphic.attribute), {
|
|
12234
12248
|
angle: 0,
|
|
@@ -12241,20 +12255,18 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
12241
12255
|
})).clone());
|
|
12242
12256
|
if (graphic.backgroundImg && graphic.resources) {
|
|
12243
12257
|
const res = graphic.resources.get(background);
|
|
12244
|
-
if ("success" !== res.state || !res.data) return void restore();
|
|
12245
|
-
context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.
|
|
12258
|
+
if (!res || "success" !== res.state || !res.data) return void restore();
|
|
12259
|
+
context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.globalAlpha = backgroundOpacity * opacity, backgroundClip && (context.beginPath(), backgroundCornerRadius ? createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0) : context.rect(b.x1, b.y1, b.width(), b.height()), context.clip()), this.doDrawImage(context, res.data, b, {
|
|
12246
12260
|
backgroundMode: backgroundMode,
|
|
12247
12261
|
backgroundFit: backgroundFit,
|
|
12248
|
-
backgroundKeepAspectRatio: backgroundKeepAspectRatio
|
|
12262
|
+
backgroundKeepAspectRatio: backgroundKeepAspectRatio,
|
|
12263
|
+
backgroundScale: backgroundScale,
|
|
12264
|
+
backgroundOffsetX: backgroundOffsetX,
|
|
12265
|
+
backgroundOffsetY: backgroundOffsetY,
|
|
12266
|
+
backgroundPosition: backgroundPosition
|
|
12249
12267
|
}), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
12250
|
-
} else
|
|
12251
|
-
|
|
12252
|
-
backgroundCornerRadius: backgroundCornerRadius,
|
|
12253
|
-
backgroundOpacity = 1
|
|
12254
|
-
} = graphic.attribute;
|
|
12255
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
12256
|
-
}
|
|
12257
|
-
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
12268
|
+
} else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity * opacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
12269
|
+
backgroundConfig && boundsAllocate.free(b), restore();
|
|
12258
12270
|
}
|
|
12259
12271
|
}
|
|
12260
12272
|
const defaultTextBackgroundRenderContribution = new DefaultTextBackgroundRenderContribution();
|
|
@@ -12416,8 +12428,7 @@ function drawPolygon(path, points, x, y) {
|
|
|
12416
12428
|
for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
|
|
12417
12429
|
}
|
|
12418
12430
|
}
|
|
12419
|
-
function drawRoundedPolygon(path, points, x, y, cornerRadius) {
|
|
12420
|
-
let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
12431
|
+
function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
|
|
12421
12432
|
var _a;
|
|
12422
12433
|
if (points.length < 3) return void drawPolygon(path, points, x, y);
|
|
12423
12434
|
let startI = 0,
|
|
@@ -12682,6 +12693,92 @@ var __decorate$w = undefined && undefined.__decorate || function (decorators, ta
|
|
|
12682
12693
|
};
|
|
12683
12694
|
};
|
|
12684
12695
|
const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
|
|
12696
|
+
function resolveImageMode({
|
|
12697
|
+
repeatX = "no-repeat",
|
|
12698
|
+
repeatY = "no-repeat",
|
|
12699
|
+
imageMode: imageMode
|
|
12700
|
+
}) {
|
|
12701
|
+
const repeatMode = resolveImageRepeatMode(repeatX, repeatY);
|
|
12702
|
+
return {
|
|
12703
|
+
repeatMode: repeatMode,
|
|
12704
|
+
sizingMode: "no-repeat" === repeatMode && null != imageMode ? imageMode : "fill"
|
|
12705
|
+
};
|
|
12706
|
+
}
|
|
12707
|
+
const IMAGE_MODE_TO_BACKGROUND_MODE = {
|
|
12708
|
+
cover: "no-repeat-cover",
|
|
12709
|
+
contain: "no-repeat-contain",
|
|
12710
|
+
fill: "no-repeat-fill",
|
|
12711
|
+
auto: "no-repeat-auto"
|
|
12712
|
+
};
|
|
12713
|
+
function resolveBackgroundParamsByImageSizing(sizingMode) {
|
|
12714
|
+
return {
|
|
12715
|
+
backgroundMode: IMAGE_MODE_TO_BACKGROUND_MODE[sizingMode],
|
|
12716
|
+
backgroundFit: !1,
|
|
12717
|
+
backgroundKeepAspectRatio: !1
|
|
12718
|
+
};
|
|
12719
|
+
}
|
|
12720
|
+
function resolveImageRepeatMode(repeatX, repeatY) {
|
|
12721
|
+
let repeat = 0;
|
|
12722
|
+
return "repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat ? repeatStr[repeat] : "no-repeat";
|
|
12723
|
+
}
|
|
12724
|
+
function shouldClipImageByLayout({
|
|
12725
|
+
repeatX = "no-repeat",
|
|
12726
|
+
repeatY = "no-repeat",
|
|
12727
|
+
imageMode: imageMode,
|
|
12728
|
+
imageScale = 1,
|
|
12729
|
+
imageOffsetX = 0,
|
|
12730
|
+
imageOffsetY = 0,
|
|
12731
|
+
imagePosition = "top-left"
|
|
12732
|
+
}) {
|
|
12733
|
+
const {
|
|
12734
|
+
repeatMode: repeatMode,
|
|
12735
|
+
sizingMode: sizingMode
|
|
12736
|
+
} = resolveImageMode({
|
|
12737
|
+
repeatX: repeatX,
|
|
12738
|
+
repeatY: repeatY,
|
|
12739
|
+
imageMode: imageMode
|
|
12740
|
+
});
|
|
12741
|
+
return "no-repeat" === repeatMode && ("cover" === sizingMode || "auto" === sizingMode || 1 !== imageScale || 0 !== imageOffsetX || 0 !== imageOffsetY);
|
|
12742
|
+
}
|
|
12743
|
+
function drawImageWithLayout(context, data, x, y, width, height, {
|
|
12744
|
+
repeatX = "no-repeat",
|
|
12745
|
+
repeatY = "no-repeat",
|
|
12746
|
+
imageMode: imageMode,
|
|
12747
|
+
imageScale = 1,
|
|
12748
|
+
imageOffsetX = 0,
|
|
12749
|
+
imageOffsetY = 0,
|
|
12750
|
+
imagePosition = "top-left"
|
|
12751
|
+
}) {
|
|
12752
|
+
const {
|
|
12753
|
+
repeatMode: repeatMode,
|
|
12754
|
+
sizingMode: sizingMode
|
|
12755
|
+
} = resolveImageMode({
|
|
12756
|
+
repeatX: repeatX,
|
|
12757
|
+
repeatY: repeatY,
|
|
12758
|
+
imageMode: imageMode
|
|
12759
|
+
}),
|
|
12760
|
+
imageBackgroundParams = "no-repeat" === repeatMode ? resolveBackgroundParamsByImageSizing(sizingMode) : {
|
|
12761
|
+
backgroundMode: repeatMode,
|
|
12762
|
+
backgroundFit: !1,
|
|
12763
|
+
backgroundKeepAspectRatio: !1
|
|
12764
|
+
};
|
|
12765
|
+
drawBackgroundImage(context, data, {
|
|
12766
|
+
x1: x,
|
|
12767
|
+
y1: y,
|
|
12768
|
+
x2: x + width,
|
|
12769
|
+
y2: y + height,
|
|
12770
|
+
width: () => width,
|
|
12771
|
+
height: () => height
|
|
12772
|
+
}, {
|
|
12773
|
+
backgroundMode: imageBackgroundParams.backgroundMode,
|
|
12774
|
+
backgroundFit: imageBackgroundParams.backgroundFit,
|
|
12775
|
+
backgroundKeepAspectRatio: imageBackgroundParams.backgroundKeepAspectRatio,
|
|
12776
|
+
backgroundScale: imageScale,
|
|
12777
|
+
backgroundOffsetX: imageOffsetX,
|
|
12778
|
+
backgroundOffsetY: imageOffsetY,
|
|
12779
|
+
backgroundPosition: imagePosition
|
|
12780
|
+
});
|
|
12781
|
+
}
|
|
12685
12782
|
let DefaultCanvasImageRender = class extends BaseRender {
|
|
12686
12783
|
constructor(graphicRenderContributions) {
|
|
12687
12784
|
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(graphicRenderContributions);
|
|
@@ -12696,6 +12793,11 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
12696
12793
|
cornerRadius = imageAttribute.cornerRadius,
|
|
12697
12794
|
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
12698
12795
|
cornerType = imageAttribute.cornerType,
|
|
12796
|
+
imageMode = imageAttribute.imageMode,
|
|
12797
|
+
imageScale = imageAttribute.imageScale,
|
|
12798
|
+
imageOffsetX = imageAttribute.imageOffsetX,
|
|
12799
|
+
imageOffsetY = imageAttribute.imageOffsetY,
|
|
12800
|
+
imagePosition = imageAttribute.imagePosition,
|
|
12699
12801
|
image: url
|
|
12700
12802
|
} = image.attribute,
|
|
12701
12803
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -12712,22 +12814,33 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
12712
12814
|
const width = image.width,
|
|
12713
12815
|
height = image.height;
|
|
12714
12816
|
context.beginPath();
|
|
12715
|
-
let
|
|
12716
|
-
0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? context.rect(x, y, width, height) : (createRectPath(context, x, y, width, height, cornerRadius, "bevel" !== cornerType),
|
|
12817
|
+
let needCornerClip = !1;
|
|
12818
|
+
0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? context.rect(x, y, width, height) : (createRectPath(context, x, y, width, height, cornerRadius, "bevel" !== cornerType), needCornerClip = !0), context.setShadowBlendStyle && context.setShadowBlendStyle(image, image.attribute, imageAttribute);
|
|
12717
12819
|
const _runFill = () => {
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12820
|
+
doFill && (fillCb ? fillCb(context, image.attribute, imageAttribute) : fVisible && (context.setCommonStyle(image, image.attribute, x, y, imageAttribute), drawImageWithLayout(context, res.data, x, y, width, height, {
|
|
12821
|
+
repeatX: repeatX,
|
|
12822
|
+
repeatY: repeatY,
|
|
12823
|
+
imageMode: imageMode,
|
|
12824
|
+
imageScale: imageScale,
|
|
12825
|
+
imageOffsetX: imageOffsetX,
|
|
12826
|
+
imageOffsetY: imageOffsetY,
|
|
12827
|
+
imagePosition: imagePosition
|
|
12828
|
+
})));
|
|
12726
12829
|
},
|
|
12727
12830
|
_runStroke = () => {
|
|
12728
12831
|
doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
|
|
12729
|
-
}
|
|
12730
|
-
|
|
12832
|
+
},
|
|
12833
|
+
needLayoutClip = shouldClipImageByLayout({
|
|
12834
|
+
repeatX: repeatX,
|
|
12835
|
+
repeatY: repeatY,
|
|
12836
|
+
imageMode: imageMode,
|
|
12837
|
+
imageScale: imageScale,
|
|
12838
|
+
imageOffsetX: imageOffsetX,
|
|
12839
|
+
imageOffsetY: imageOffsetY,
|
|
12840
|
+
imagePosition: imagePosition
|
|
12841
|
+
}),
|
|
12842
|
+
needClip = needCornerClip || needLayoutClip;
|
|
12843
|
+
fillStrokeOrder ? (_runStroke(), needClip && (context.save(), context.clip()), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), _runFill(), needClip && context.restore()) : (needClip && (context.save(), context.clip()), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), _runFill(), needClip && context.restore(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
12731
12844
|
}
|
|
12732
12845
|
draw(image, renderService, drawContext) {
|
|
12733
12846
|
const {
|
|
@@ -13174,7 +13287,7 @@ let DefaultPluginService = class {
|
|
|
13174
13287
|
unRegister(plugin) {
|
|
13175
13288
|
"onStartupFinished" === plugin.activeEvent ? this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1) : "onRegister" === plugin.activeEvent && this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1), plugin.deactivate(this);
|
|
13176
13289
|
}
|
|
13177
|
-
release() {
|
|
13290
|
+
release(...params) {
|
|
13178
13291
|
this.onStartupFinishedPlugin.forEach(plugin => {
|
|
13179
13292
|
plugin.deactivate(this);
|
|
13180
13293
|
}), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(plugin => {
|
|
@@ -13321,9 +13434,7 @@ function parseChildMap(graphic, defaultZIndex, reverse) {
|
|
|
13321
13434
|
zIdxArray: zIdxArray
|
|
13322
13435
|
};
|
|
13323
13436
|
}
|
|
13324
|
-
function foreach(graphic, defaultZIndex, cb) {
|
|
13325
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
13326
|
-
let sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
13437
|
+
function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
|
|
13327
13438
|
let needSort = !1;
|
|
13328
13439
|
if (sort3d) needSort = !0;else {
|
|
13329
13440
|
let lastZIndex;
|
|
@@ -13354,14 +13465,12 @@ function foreach(graphic, defaultZIndex, cb) {
|
|
|
13354
13465
|
}
|
|
13355
13466
|
} else graphic.forEachChildren(cb, reverse);
|
|
13356
13467
|
}
|
|
13357
|
-
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
13358
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
13468
|
+
function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
|
|
13359
13469
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
13360
13470
|
yield graphic.forEachChildrenAsync(cb, reverse);
|
|
13361
13471
|
});
|
|
13362
13472
|
}
|
|
13363
|
-
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
13364
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
13473
|
+
function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
|
|
13365
13474
|
let needSort = !1;
|
|
13366
13475
|
graphic.forEachChildren((item, i) => {
|
|
13367
13476
|
const {
|
|
@@ -13586,7 +13695,7 @@ let DefaultDrawContribution = class {
|
|
|
13586
13695
|
return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
13587
13696
|
}
|
|
13588
13697
|
clearScreen(renderService, context, drawContext) {
|
|
13589
|
-
var _a, _b, _c;
|
|
13698
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
13590
13699
|
const {
|
|
13591
13700
|
clear: clear,
|
|
13592
13701
|
viewBox: viewBox
|
|
@@ -13596,9 +13705,20 @@ let DefaultDrawContribution = class {
|
|
|
13596
13705
|
if (clear) {
|
|
13597
13706
|
context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
|
|
13598
13707
|
const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
|
|
13599
|
-
if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
|
|
13600
|
-
const res = stage.resources.get(clear);
|
|
13601
|
-
res && "success" === res.state && res.data
|
|
13708
|
+
if (stage && (context.globalAlpha = (null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1) * (null !== (_d = stage.attribute.backgroundOpacity) && void 0 !== _d ? _d : 1)), stage && stage.backgroundImg && stage.resources) {
|
|
13709
|
+
const res = stage.resources.get(getBackgroundImage(clear));
|
|
13710
|
+
if (res && "success" === res.state && res.data) {
|
|
13711
|
+
const backgroundBounds = boundsAllocate.allocate(0, 0, 0 + width, 0 + height);
|
|
13712
|
+
drawBackgroundImage(context, res.data, backgroundBounds, {
|
|
13713
|
+
backgroundMode: null !== (_e = stage.attribute.backgroundMode) && void 0 !== _e ? _e : DefaultAttribute.backgroundMode,
|
|
13714
|
+
backgroundFit: null !== (_f = stage.attribute.backgroundFit) && void 0 !== _f ? _f : DefaultAttribute.backgroundFit,
|
|
13715
|
+
backgroundKeepAspectRatio: null !== (_g = stage.attribute.backgroundKeepAspectRatio) && void 0 !== _g ? _g : DefaultAttribute.backgroundKeepAspectRatio,
|
|
13716
|
+
backgroundScale: null !== (_h = stage.attribute.backgroundScale) && void 0 !== _h ? _h : DefaultAttribute.backgroundScale,
|
|
13717
|
+
backgroundOffsetX: null !== (_j = stage.attribute.backgroundOffsetX) && void 0 !== _j ? _j : DefaultAttribute.backgroundOffsetX,
|
|
13718
|
+
backgroundOffsetY: null !== (_k = stage.attribute.backgroundOffsetY) && void 0 !== _k ? _k : DefaultAttribute.backgroundOffsetY,
|
|
13719
|
+
backgroundPosition: null !== (_l = stage.attribute.backgroundPosition) && void 0 !== _l ? _l : DefaultAttribute.backgroundPosition
|
|
13720
|
+
}), boundsAllocate.free(backgroundBounds);
|
|
13721
|
+
}
|
|
13602
13722
|
} else context.fillStyle = createColor(context, clear, {
|
|
13603
13723
|
AABBBounds: {
|
|
13604
13724
|
x1: 0,
|
|
@@ -18993,8 +19113,7 @@ class Step {
|
|
|
18993
19113
|
getLastProps() {
|
|
18994
19114
|
return this.prev ? this.prev.props || {} : this.animate.getStartProps();
|
|
18995
19115
|
}
|
|
18996
|
-
setDuration(duration) {
|
|
18997
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
19116
|
+
setDuration(duration, updateDownstream = !0) {
|
|
18998
19117
|
this.duration = duration, updateDownstream && this.updateDownstreamStartTimes();
|
|
18999
19118
|
}
|
|
19000
19119
|
getDuration() {
|
|
@@ -19015,8 +19134,7 @@ class Step {
|
|
|
19015
19134
|
} else interpolateUpdateStore[key] ? funcs.push(interpolateUpdateStore[key]) : funcs.push(commonInterpolateUpdate);
|
|
19016
19135
|
}), this.interpolateUpdateFunctions = funcs;
|
|
19017
19136
|
}
|
|
19018
|
-
setStartTime(time) {
|
|
19019
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
19137
|
+
setStartTime(time, updateDownstream = !0) {
|
|
19020
19138
|
this._startTime = time, updateDownstream && this.updateDownstreamStartTimes();
|
|
19021
19139
|
}
|
|
19022
19140
|
getStartTime() {
|
|
@@ -19142,8 +19260,7 @@ class DefaultTimeline extends EventEmitter {
|
|
|
19142
19260
|
animate.release();
|
|
19143
19261
|
}), this.head = null, this.tail = null, this.animateMap.clear(), this._animateCount = 0, this._totalDuration = 0;
|
|
19144
19262
|
}
|
|
19145
|
-
removeAnimate(animate) {
|
|
19146
|
-
let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
19263
|
+
removeAnimate(animate, release = !0) {
|
|
19147
19264
|
const node = this.animateMap.get(animate);
|
|
19148
19265
|
node && (release && (animate._onRemove && animate._onRemove.forEach(cb => cb()), animate.release()), node.prev ? node.prev.next = node.next : this.head = node.next, node.next ? node.next.prev = node.prev : this.tail = node.prev, this.animateMap.delete(animate), this._animateCount--, animate.getStartTime() + animate.getDuration() >= this._totalDuration && this.recalculateTotalDuration());
|
|
19149
19266
|
}
|
|
@@ -19181,10 +19298,7 @@ const defaultTimeline = new DefaultTimeline();
|
|
|
19181
19298
|
defaultTimeline.isGlobal = !0;
|
|
19182
19299
|
|
|
19183
19300
|
class Animate {
|
|
19184
|
-
constructor() {
|
|
19185
|
-
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
19186
|
-
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
19187
|
-
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
19301
|
+
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
19188
19302
|
this.id = id, this.status = AnimateStatus.INITIAL, this._timeline = timeline, timeline.addAnimate(this), this.slience = slience, this._startTime = 0, this._duration = 0, this._totalDuration = 0, this._loopCount = 0, this._currentLoop = 0, this._bounce = !1, this._firstStep = null, this._lastStep = null, this._startProps = {}, this._endProps = {}, this._preventAttrs = new Set(), this.currentTime = 0, this.interpolateUpdateFunction = null, this.priority = 0;
|
|
19189
19303
|
}
|
|
19190
19304
|
getStartProps() {
|
|
@@ -19207,9 +19321,7 @@ class Animate {
|
|
|
19207
19321
|
this.stop(), this.target.animates.delete(this.id);
|
|
19208
19322
|
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
19209
19323
|
}
|
|
19210
|
-
to(props) {
|
|
19211
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
19212
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
19324
|
+
to(props, duration = 300, easing = "linear") {
|
|
19213
19325
|
const step = new Step(AnimateStepType.to, props, duration, easing);
|
|
19214
19326
|
return step.bind(this.target, this), this.updateStepAfterAppend(step), this;
|
|
19215
19327
|
}
|
|
@@ -19239,9 +19351,7 @@ class Animate {
|
|
|
19239
19351
|
this._endProps[key] = currentStep.props[key];
|
|
19240
19352
|
}), currentStep = currentStep.next;
|
|
19241
19353
|
}
|
|
19242
|
-
from(props) {
|
|
19243
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
19244
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
19354
|
+
from(props, duration = 300, easing = "linear") {
|
|
19245
19355
|
const step = new Step(AnimateStepType.from, props, duration, easing);
|
|
19246
19356
|
return this._firstStep ? (this._lastStep.append(step), this._lastStep = step) : (this._firstStep = step, this._lastStep = step), this.updateDuration(), this;
|
|
19247
19357
|
}
|
|
@@ -19441,12 +19551,10 @@ class DefaultTicker extends EventEmitter {
|
|
|
19441
19551
|
getTimelines() {
|
|
19442
19552
|
return this.timelines;
|
|
19443
19553
|
}
|
|
19444
|
-
initHandler() {
|
|
19445
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
19554
|
+
initHandler(force = !1) {
|
|
19446
19555
|
this.setupTickHandler(force);
|
|
19447
19556
|
}
|
|
19448
|
-
setupTickHandler() {
|
|
19449
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
19557
|
+
setupTickHandler(force = !1) {
|
|
19450
19558
|
if (!force && this.tickerHandler) return !0;
|
|
19451
19559
|
const handler = new RAFTickHandler();
|
|
19452
19560
|
return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
|
|
@@ -19488,8 +19596,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
19488
19596
|
}
|
|
19489
19597
|
return !1;
|
|
19490
19598
|
}
|
|
19491
|
-
start() {
|
|
19492
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
19599
|
+
start(force = !1) {
|
|
19493
19600
|
if (this.status === STATUS$1.RUNNING) return !1;
|
|
19494
19601
|
if (!this.tickerHandler) return !1;
|
|
19495
19602
|
if (!force) {
|
|
@@ -19620,6 +19727,7 @@ function getCustomType(custom) {
|
|
|
19620
19727
|
if (custom.prototype.constructor === custom) {
|
|
19621
19728
|
const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
|
|
19622
19729
|
if (descriptor && !descriptor.writable) return 1;
|
|
19730
|
+
if (Object.getOwnPropertyNames(custom.prototype).length > 1) return 1;
|
|
19623
19731
|
}
|
|
19624
19732
|
return 2;
|
|
19625
19733
|
}
|
|
@@ -19879,22 +19987,17 @@ class AnimateExecutor {
|
|
|
19879
19987
|
var _a, _b;
|
|
19880
19988
|
return void 0 === value ? defaultValue : "function" == typeof value && graphic ? value(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : value;
|
|
19881
19989
|
}
|
|
19882
|
-
executeItem(params, graphic) {
|
|
19883
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19884
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
19990
|
+
executeItem(params, graphic, index = 0, count = 1) {
|
|
19885
19991
|
return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
|
|
19886
19992
|
}
|
|
19887
|
-
_executeItem(params, graphic) {
|
|
19888
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19889
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
19993
|
+
_executeItem(params, graphic, index = 0, count = 1) {
|
|
19890
19994
|
if (!graphic) return null;
|
|
19891
19995
|
const isTimeline = ("timeSlices" in params);
|
|
19892
19996
|
let animate = null;
|
|
19893
19997
|
const parsedParams = this.parseParams(params, isTimeline);
|
|
19894
19998
|
return animate = isTimeline ? this.executeTimelineItem(parsedParams, graphic, index, count) : this.executeTypeConfigItem(parsedParams, graphic, index, count), animate && this._trackAnimation(animate), animate;
|
|
19895
19999
|
}
|
|
19896
|
-
stop(type) {
|
|
19897
|
-
let callEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
20000
|
+
stop(type, callEnd = !0) {
|
|
19898
20001
|
for (; this._animates.length > 0;) {
|
|
19899
20002
|
const animate = this._animates.pop();
|
|
19900
20003
|
!1 === callEnd && (animate.status = AnimateStatus.END), null == animate || animate.stop(type);
|
|
@@ -20051,8 +20154,7 @@ class GraphicStateExtension {
|
|
|
20051
20154
|
applyUnhighlightState(animationConfig, callback) {
|
|
20052
20155
|
return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
|
|
20053
20156
|
}
|
|
20054
|
-
stopAnimationState(state, type) {
|
|
20055
|
-
let deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
20157
|
+
stopAnimationState(state, type, deep = !1) {
|
|
20056
20158
|
return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
|
|
20057
20159
|
child.stopAnimationState(state, type, deep);
|
|
20058
20160
|
}), this;
|
|
@@ -20061,8 +20163,7 @@ class GraphicStateExtension {
|
|
|
20061
20163
|
const stateManager = this._animationStateManager;
|
|
20062
20164
|
return stateManager && stateManager.clearState(), this;
|
|
20063
20165
|
}
|
|
20064
|
-
reApplyAnimationState(state) {
|
|
20065
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
20166
|
+
reApplyAnimationState(state, deep = !1) {
|
|
20066
20167
|
const stateManager = this._animationStateManager;
|
|
20067
20168
|
return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
|
|
20068
20169
|
child.reApplyAnimationState(state, deep);
|
|
@@ -20074,8 +20175,7 @@ class GraphicStateExtension {
|
|
|
20074
20175
|
}
|
|
20075
20176
|
|
|
20076
20177
|
class AnimateExtension {
|
|
20077
|
-
getAttributes() {
|
|
20078
|
-
let final = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
20178
|
+
getAttributes(final = !1) {
|
|
20079
20179
|
return final && this.finalAttribute ? this.finalAttribute : this.attribute;
|
|
20080
20180
|
}
|
|
20081
20181
|
animate(params) {
|
|
@@ -20117,24 +20217,20 @@ class AnimateExtension {
|
|
|
20117
20217
|
getFinalAttribute() {
|
|
20118
20218
|
return this.finalAttribute;
|
|
20119
20219
|
}
|
|
20120
|
-
getGraphicAttribute(key) {
|
|
20121
|
-
let prev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
20220
|
+
getGraphicAttribute(key, prev = !1) {
|
|
20122
20221
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
20123
20222
|
}
|
|
20124
|
-
pauseAnimation() {
|
|
20125
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
20223
|
+
pauseAnimation(deep = !1) {
|
|
20126
20224
|
this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
|
|
20127
20225
|
child.pauseAnimation(deep);
|
|
20128
20226
|
});
|
|
20129
20227
|
}
|
|
20130
|
-
resumeAnimation() {
|
|
20131
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
20228
|
+
resumeAnimation(deep = !1) {
|
|
20132
20229
|
this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
|
|
20133
20230
|
child.resumeAnimation(deep);
|
|
20134
20231
|
});
|
|
20135
20232
|
}
|
|
20136
|
-
stopAnimation() {
|
|
20137
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
20233
|
+
stopAnimation(deep = !1) {
|
|
20138
20234
|
this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
|
|
20139
20235
|
child.stopAnimation(deep);
|
|
20140
20236
|
});
|
|
@@ -35030,6 +35126,6 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
35030
35126
|
select: true
|
|
35031
35127
|
};
|
|
35032
35128
|
|
|
35033
|
-
const version = "1.0.46-alpha.
|
|
35129
|
+
const version = "1.0.46-alpha.1";
|
|
35034
35130
|
|
|
35035
35131
|
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IDataZoomEvent, IDataZoomInteractiveEvent, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|