@visactor/vrender-core 0.21.9-alpha.1 → 0.21.10
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/animate/animate.js +1 -1
- package/cjs/animate/animate.js.map +1 -1
- package/cjs/common/render-area.d.ts +0 -4
- package/cjs/common/render-area.js +16 -76
- package/cjs/common/render-area.js.map +1 -1
- package/cjs/common/render-curve.d.ts +1 -1
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/segment/step.js +1 -1
- package/cjs/common/segment/step.js.map +1 -1
- package/cjs/graphic/line.js +2 -2
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/interface/color.js.map +1 -1
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/interface/graphic.d.ts +1 -1
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/render/contributions/render/area-render.d.ts +1 -1
- package/cjs/render/contributions/render/area-render.js +16 -36
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +9 -31
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/dist/index.es.js +85 -313
- package/es/animate/animate.js +4 -3
- package/es/animate/animate.js.map +1 -1
- package/es/common/render-area.d.ts +0 -4
- package/es/common/render-area.js +16 -76
- package/es/common/render-area.js.map +1 -1
- package/es/common/render-curve.d.ts +1 -1
- package/es/common/render-curve.js.map +1 -1
- package/es/common/segment/step.js +1 -1
- package/es/common/segment/step.js.map +1 -1
- package/es/graphic/line.js +2 -2
- package/es/graphic/line.js.map +1 -1
- package/es/interface/color.js.map +1 -1
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/interface/graphic.d.ts +1 -1
- package/es/interface/graphic.js.map +1 -1
- package/es/render/contributions/render/area-render.d.ts +1 -1
- package/es/render/contributions/render/area-render.js +16 -36
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/line-render.js +9 -31
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2214,7 +2214,12 @@ let Step$1 = class Step {
|
|
|
2214
2214
|
}
|
|
2215
2215
|
else {
|
|
2216
2216
|
const x1 = this._x * (1 - this._t) + x * this._t;
|
|
2217
|
-
|
|
2217
|
+
if (this._t === 0.5) {
|
|
2218
|
+
this.context.lineTo(x1, this._y, this._lastDefined !== false, this.lastPoint);
|
|
2219
|
+
}
|
|
2220
|
+
else {
|
|
2221
|
+
this.context.lineTo(x1, this._y, this._lastDefined !== false && p.defined !== false, this.lastPoint);
|
|
2222
|
+
}
|
|
2218
2223
|
this.context.lineTo(x1, y, this._lastDefined !== false && p.defined !== false, p);
|
|
2219
2224
|
}
|
|
2220
2225
|
break;
|
|
@@ -8033,7 +8038,7 @@ class CbAnimate extends ACustomAnimate {
|
|
|
8033
8038
|
class Animate {
|
|
8034
8039
|
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
8035
8040
|
this.id = id;
|
|
8036
|
-
this.timeline = timeline;
|
|
8041
|
+
this.timeline = timeline || defaultTimeline;
|
|
8037
8042
|
this.status = AnimateStatus.INITIAL;
|
|
8038
8043
|
this.tailAnimate = new SubAnimate(this);
|
|
8039
8044
|
this.subAnimates = [this.tailAnimate];
|
|
@@ -16546,7 +16551,7 @@ let DefaultCanvasLineRender = class DefaultCanvasLineRender extends BaseRender {
|
|
|
16546
16551
|
this._draw(line, lineAttribute, false, drawContext, params);
|
|
16547
16552
|
}
|
|
16548
16553
|
drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
|
|
16549
|
-
var _a
|
|
16554
|
+
var _a;
|
|
16550
16555
|
if (!cache) {
|
|
16551
16556
|
return;
|
|
16552
16557
|
}
|
|
@@ -16585,60 +16590,6 @@ let DefaultCanvasLineRender = class DefaultCanvasLineRender extends BaseRender {
|
|
|
16585
16590
|
context.stroke();
|
|
16586
16591
|
}
|
|
16587
16592
|
}
|
|
16588
|
-
let { connectedType, connectedX, connectedY, connectedStyle } = attribute;
|
|
16589
|
-
if (isArray(defaultAttribute)) {
|
|
16590
|
-
connectedType = (_b = connectedType !== null && connectedType !== void 0 ? connectedType : defaultAttribute[0].connectedType) !== null && _b !== void 0 ? _b : defaultAttribute[1].connectedType;
|
|
16591
|
-
connectedX = (_c = connectedX !== null && connectedX !== void 0 ? connectedX : defaultAttribute[0].connectedX) !== null && _c !== void 0 ? _c : defaultAttribute[1].connectedX;
|
|
16592
|
-
connectedY = (_d = connectedY !== null && connectedY !== void 0 ? connectedY : defaultAttribute[0].connectedY) !== null && _d !== void 0 ? _d : defaultAttribute[1].connectedY;
|
|
16593
|
-
connectedStyle = (_e = connectedStyle !== null && connectedStyle !== void 0 ? connectedStyle : defaultAttribute[0].connectedStyle) !== null && _e !== void 0 ? _e : defaultAttribute[1].connectedStyle;
|
|
16594
|
-
}
|
|
16595
|
-
else {
|
|
16596
|
-
connectedType = connectedType !== null && connectedType !== void 0 ? connectedType : defaultAttribute.connectedType;
|
|
16597
|
-
connectedX = connectedX !== null && connectedX !== void 0 ? connectedX : defaultAttribute.connectedX;
|
|
16598
|
-
connectedY = connectedY !== null && connectedY !== void 0 ? connectedY : defaultAttribute.connectedY;
|
|
16599
|
-
connectedStyle = connectedStyle !== null && connectedStyle !== void 0 ? connectedStyle : defaultAttribute.connectedStyle;
|
|
16600
|
-
}
|
|
16601
|
-
if (connectedType !== 'connect' && connectedType !== 'zero') {
|
|
16602
|
-
connectedType = 'none';
|
|
16603
|
-
}
|
|
16604
|
-
if (connectedType !== 'none') {
|
|
16605
|
-
context.beginPath();
|
|
16606
|
-
drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
16607
|
-
offsetX,
|
|
16608
|
-
offsetY,
|
|
16609
|
-
offsetZ: z,
|
|
16610
|
-
drawConnect: true,
|
|
16611
|
-
mode: connectedType,
|
|
16612
|
-
zeroX: connectedX,
|
|
16613
|
-
zeroY: connectedY
|
|
16614
|
-
});
|
|
16615
|
-
const da = [];
|
|
16616
|
-
if (isArray(defaultAttribute)) {
|
|
16617
|
-
defaultAttribute.forEach(i => da.push(i));
|
|
16618
|
-
}
|
|
16619
|
-
else {
|
|
16620
|
-
da.push(defaultAttribute);
|
|
16621
|
-
}
|
|
16622
|
-
da.push(attribute);
|
|
16623
|
-
if (fill !== false) {
|
|
16624
|
-
if (fillCb) {
|
|
16625
|
-
fillCb(context, attribute, defaultAttribute);
|
|
16626
|
-
}
|
|
16627
|
-
else if (fillOpacity) {
|
|
16628
|
-
context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da);
|
|
16629
|
-
context.fill();
|
|
16630
|
-
}
|
|
16631
|
-
}
|
|
16632
|
-
if (stroke !== false) {
|
|
16633
|
-
if (strokeCb) {
|
|
16634
|
-
strokeCb(context, attribute, defaultAttribute);
|
|
16635
|
-
}
|
|
16636
|
-
else if (strokeOpacity) {
|
|
16637
|
-
context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da);
|
|
16638
|
-
context.stroke();
|
|
16639
|
-
}
|
|
16640
|
-
}
|
|
16641
|
-
}
|
|
16642
16593
|
return !!ret;
|
|
16643
16594
|
}
|
|
16644
16595
|
drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
|
|
@@ -16675,7 +16626,7 @@ let DefaultCanvasLineRender = class DefaultCanvasLineRender extends BaseRender {
|
|
|
16675
16626
|
}
|
|
16676
16627
|
drawShape(line, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
16677
16628
|
const lineAttribute = getTheme(line, params === null || params === void 0 ? void 0 : params.theme).line;
|
|
16678
|
-
const { fill = lineAttribute.fill, stroke = lineAttribute.stroke, fillOpacity = lineAttribute.fillOpacity, strokeOpacity = lineAttribute.strokeOpacity, segments, points, closePath, curveTension = lineAttribute.curveTension } = line.attribute;
|
|
16629
|
+
const { fill = lineAttribute.fill, stroke = lineAttribute.stroke, fillOpacity = lineAttribute.fillOpacity, strokeOpacity = lineAttribute.strokeOpacity, segments, points, closePath, curveTension = lineAttribute.curveTension, connectedType = lineAttribute.connectedType } = line.attribute;
|
|
16679
16630
|
const data = this.valid(line, lineAttribute, fillCb, strokeCb);
|
|
16680
16631
|
if (!data) {
|
|
16681
16632
|
return;
|
|
@@ -16688,6 +16639,12 @@ let DefaultCanvasLineRender = class DefaultCanvasLineRender extends BaseRender {
|
|
|
16688
16639
|
if (clipRange === 1 && !segments && !points.some(p => p.defined === false) && curveType === 'linear') {
|
|
16689
16640
|
return this.drawLinearLineHighPerformance(line, context, !!fill, !!stroke, fillOpacity, strokeOpacity, x, y, lineAttribute, drawContext, params, fillCb, strokeCb);
|
|
16690
16641
|
}
|
|
16642
|
+
function parsePoint(points, connectedType) {
|
|
16643
|
+
if (connectedType === 'none') {
|
|
16644
|
+
return points;
|
|
16645
|
+
}
|
|
16646
|
+
return points.filter(p => p.defined !== false);
|
|
16647
|
+
}
|
|
16691
16648
|
if (line.shouldUpdateShape()) {
|
|
16692
16649
|
const { points, segments } = line.attribute;
|
|
16693
16650
|
const _points = points;
|
|
@@ -16719,7 +16676,7 @@ let DefaultCanvasLineRender = class DefaultCanvasLineRender extends BaseRender {
|
|
|
16719
16676
|
startPoint.y = lastSeg.endY;
|
|
16720
16677
|
startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined;
|
|
16721
16678
|
}
|
|
16722
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
16679
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
16723
16680
|
startPoint,
|
|
16724
16681
|
curveTension
|
|
16725
16682
|
});
|
|
@@ -16745,7 +16702,7 @@ let DefaultCanvasLineRender = class DefaultCanvasLineRender extends BaseRender {
|
|
|
16745
16702
|
}
|
|
16746
16703
|
}
|
|
16747
16704
|
else if (points && points.length) {
|
|
16748
|
-
line.cache = calcLineCache(_points, curveType, { curveTension });
|
|
16705
|
+
line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, { curveTension });
|
|
16749
16706
|
}
|
|
16750
16707
|
else {
|
|
16751
16708
|
line.cache = null;
|
|
@@ -16797,10 +16754,6 @@ DefaultCanvasLineRender = __decorate([
|
|
|
16797
16754
|
|
|
16798
16755
|
function drawAreaSegments(path, segPath, percent, params) {
|
|
16799
16756
|
var _a;
|
|
16800
|
-
const { drawConnect = false, mode = 'none' } = params || {};
|
|
16801
|
-
if (drawConnect && mode === 'none') {
|
|
16802
|
-
return;
|
|
16803
|
-
}
|
|
16804
16757
|
const { top, bottom } = segPath;
|
|
16805
16758
|
if (top.curves.length !== bottom.curves.length) {
|
|
16806
16759
|
return;
|
|
@@ -16809,90 +16762,28 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
16809
16762
|
const topList = [];
|
|
16810
16763
|
const bottomList = [];
|
|
16811
16764
|
let lastDefined = true;
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
let currentTopCurve = curve;
|
|
16820
|
-
let currentBottomCurve = bototmCurve;
|
|
16821
|
-
if (curve.originP1 === curve.originP2) {
|
|
16822
|
-
lastCurve = curve;
|
|
16823
|
-
lastBottomCurve = bototmCurve;
|
|
16824
|
-
return;
|
|
16825
|
-
}
|
|
16826
|
-
if (lastCurve && lastCurve.originP1 === lastCurve.originP2) {
|
|
16827
|
-
currentTopCurve = lastCurve;
|
|
16828
|
-
currentBottomCurve = lastBottomCurve;
|
|
16829
|
-
}
|
|
16830
|
-
if (curve.defined) {
|
|
16831
|
-
if (!defined0) {
|
|
16832
|
-
topList.push(currentTopCurve);
|
|
16833
|
-
bottomList.push(currentBottomCurve);
|
|
16834
|
-
drawAreaConnectBlock(path, topList, bottomList, params);
|
|
16835
|
-
topList.length = 0;
|
|
16836
|
-
bottomList.length = 0;
|
|
16837
|
-
defined0 = !defined0;
|
|
16838
|
-
}
|
|
16765
|
+
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
16766
|
+
const topCurve = top.curves[i];
|
|
16767
|
+
if (lastDefined !== topCurve.defined) {
|
|
16768
|
+
if (lastDefined) {
|
|
16769
|
+
drawAreaBlock(path, topList, bottomList, params);
|
|
16770
|
+
topList.length = 0;
|
|
16771
|
+
bottomList.length = 0;
|
|
16839
16772
|
}
|
|
16840
16773
|
else {
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
let validBottomCurve;
|
|
16844
|
-
if (originP1 && originP1.defined !== false) {
|
|
16845
|
-
validTopCurve = currentTopCurve;
|
|
16846
|
-
validBottomCurve = currentBottomCurve;
|
|
16847
|
-
}
|
|
16848
|
-
else if (originP1 && originP2.defined !== false) {
|
|
16849
|
-
validTopCurve = curve;
|
|
16850
|
-
validBottomCurve = bototmCurve;
|
|
16851
|
-
}
|
|
16852
|
-
if (defined0) {
|
|
16853
|
-
defined0 = !defined0;
|
|
16854
|
-
topList.push(validTopCurve || curve);
|
|
16855
|
-
bottomList.push(validBottomCurve || bototmCurve);
|
|
16856
|
-
}
|
|
16857
|
-
else {
|
|
16858
|
-
if (validTopCurve) {
|
|
16859
|
-
defined0 = !defined0;
|
|
16860
|
-
topList.push(validTopCurve || curve);
|
|
16861
|
-
bottomList.push(validBottomCurve || bototmCurve);
|
|
16862
|
-
drawAreaConnectBlock(path, topList, bottomList, params);
|
|
16863
|
-
topList.length = 0;
|
|
16864
|
-
bottomList.length = 0;
|
|
16865
|
-
}
|
|
16866
|
-
}
|
|
16867
|
-
}
|
|
16868
|
-
lastCurve = curve;
|
|
16869
|
-
});
|
|
16870
|
-
drawAreaConnectBlock(path, topList, bottomList, params);
|
|
16871
|
-
}
|
|
16872
|
-
else {
|
|
16873
|
-
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
16874
|
-
const topCurve = top.curves[i];
|
|
16875
|
-
if (lastDefined !== topCurve.defined) {
|
|
16876
|
-
if (lastDefined) {
|
|
16877
|
-
drawAreaBlock(path, topList, bottomList, params);
|
|
16878
|
-
topList.length = 0;
|
|
16879
|
-
bottomList.length = 0;
|
|
16880
|
-
}
|
|
16881
|
-
else {
|
|
16882
|
-
topList.push(topCurve);
|
|
16883
|
-
bottomList.push(bottom.curves[n - i - 1]);
|
|
16884
|
-
}
|
|
16885
|
-
lastDefined = !lastDefined;
|
|
16774
|
+
topList.push(topCurve);
|
|
16775
|
+
bottomList.push(bottom.curves[n - i - 1]);
|
|
16886
16776
|
}
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16777
|
+
lastDefined = !lastDefined;
|
|
16778
|
+
}
|
|
16779
|
+
else {
|
|
16780
|
+
if (lastDefined) {
|
|
16781
|
+
topList.push(topCurve);
|
|
16782
|
+
bottomList.push(bottom.curves[n - i - 1]);
|
|
16892
16783
|
}
|
|
16893
16784
|
}
|
|
16894
|
-
drawAreaBlock(path, topList, bottomList, params);
|
|
16895
16785
|
}
|
|
16786
|
+
drawAreaBlock(path, topList, bottomList, params);
|
|
16896
16787
|
return;
|
|
16897
16788
|
}
|
|
16898
16789
|
if (percent <= 0) {
|
|
@@ -16916,9 +16807,6 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
16916
16807
|
let lastDefined = true;
|
|
16917
16808
|
const topList = [];
|
|
16918
16809
|
const bottomList = [];
|
|
16919
|
-
let defined0 = true;
|
|
16920
|
-
let lastTopCurve;
|
|
16921
|
-
let lastBottomCurve;
|
|
16922
16810
|
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
16923
16811
|
const topCurve = top.curves[i];
|
|
16924
16812
|
const curCurveLength = topCurve.getLength(direction);
|
|
@@ -16927,127 +16815,50 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
16927
16815
|
break;
|
|
16928
16816
|
}
|
|
16929
16817
|
drawedLengthUntilLast += curCurveLength;
|
|
16930
|
-
|
|
16931
|
-
|
|
16932
|
-
|
|
16933
|
-
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
continue;
|
|
16938
|
-
}
|
|
16939
|
-
if (lastTopCurve && lastTopCurve.originP1 === lastTopCurve.originP2) {
|
|
16940
|
-
currentTopCurve = lastTopCurve;
|
|
16941
|
-
currentBottomCurve = lastBottomCurve;
|
|
16942
|
-
}
|
|
16943
|
-
if (topCurve.defined) {
|
|
16944
|
-
if (!defined0) {
|
|
16945
|
-
topList.push(currentTopCurve);
|
|
16946
|
-
bottomList.push(currentBottomCurve);
|
|
16947
|
-
drawAreaConnectBlock(path, topList, bottomList, params);
|
|
16948
|
-
topList.length = 0;
|
|
16949
|
-
bottomList.length = 0;
|
|
16950
|
-
defined0 = !defined0;
|
|
16951
|
-
}
|
|
16818
|
+
let tc = null;
|
|
16819
|
+
let bc = null;
|
|
16820
|
+
if (lastDefined !== topCurve.defined) {
|
|
16821
|
+
if (lastDefined) {
|
|
16822
|
+
drawAreaBlock(path, topList, bottomList, params);
|
|
16823
|
+
topList.length = 0;
|
|
16824
|
+
bottomList.length = 0;
|
|
16952
16825
|
}
|
|
16953
16826
|
else {
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
let validBottomCurve;
|
|
16957
|
-
if (originP1 && originP1.defined !== false) {
|
|
16958
|
-
validTopCurve = currentTopCurve;
|
|
16959
|
-
validBottomCurve = currentBottomCurve;
|
|
16960
|
-
}
|
|
16961
|
-
else if (originP1 && originP2.defined !== false) {
|
|
16962
|
-
validTopCurve = topCurve;
|
|
16963
|
-
validBottomCurve = bototmCurve;
|
|
16964
|
-
}
|
|
16965
|
-
if (defined0) {
|
|
16966
|
-
defined0 = !defined0;
|
|
16967
|
-
topList.push(validTopCurve || topCurve);
|
|
16968
|
-
bottomList.push(validBottomCurve || bototmCurve);
|
|
16969
|
-
}
|
|
16970
|
-
else {
|
|
16971
|
-
if (validTopCurve) {
|
|
16972
|
-
defined0 = !defined0;
|
|
16973
|
-
topList.push(validTopCurve || topCurve);
|
|
16974
|
-
bottomList.push(validBottomCurve || bototmCurve);
|
|
16975
|
-
drawAreaConnectBlock(path, topList, bottomList, params);
|
|
16976
|
-
topList.length = 0;
|
|
16977
|
-
bottomList.length = 0;
|
|
16978
|
-
}
|
|
16979
|
-
}
|
|
16827
|
+
tc = topCurve;
|
|
16828
|
+
bc = bottom.curves[n - i - 1];
|
|
16980
16829
|
}
|
|
16981
|
-
|
|
16830
|
+
lastDefined = !lastDefined;
|
|
16982
16831
|
}
|
|
16983
16832
|
else {
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16833
|
+
if (lastDefined) {
|
|
16834
|
+
tc = topCurve;
|
|
16835
|
+
bc = bottom.curves[n - i - 1];
|
|
16836
|
+
}
|
|
16837
|
+
}
|
|
16838
|
+
if (tc && bc) {
|
|
16839
|
+
if (percent < 1) {
|
|
16840
|
+
if (tc.p2 && tc.p3) {
|
|
16841
|
+
tc = divideCubic(tc, percent)[0];
|
|
16991
16842
|
}
|
|
16992
16843
|
else {
|
|
16993
|
-
tc =
|
|
16994
|
-
bc = bottom.curves[n - i - 1];
|
|
16844
|
+
tc = divideLinear(tc, percent)[0];
|
|
16995
16845
|
}
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
else {
|
|
16999
|
-
if (lastDefined) {
|
|
17000
|
-
tc = topCurve;
|
|
17001
|
-
bc = bottom.curves[n - i - 1];
|
|
16846
|
+
if (bc.p2 && bc.p3) {
|
|
16847
|
+
bc = divideCubic(bc, 1 - percent)[1];
|
|
17002
16848
|
}
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
if (percent < 1) {
|
|
17006
|
-
if (tc.p2 && tc.p3) {
|
|
17007
|
-
tc = divideCubic(tc, percent)[0];
|
|
17008
|
-
}
|
|
17009
|
-
else {
|
|
17010
|
-
tc = divideLinear(tc, percent)[0];
|
|
17011
|
-
}
|
|
17012
|
-
if (bc.p2 && bc.p3) {
|
|
17013
|
-
bc = divideCubic(bc, 1 - percent)[1];
|
|
17014
|
-
}
|
|
17015
|
-
else {
|
|
17016
|
-
bc = divideLinear(bc, 1 - percent)[1];
|
|
17017
|
-
}
|
|
16849
|
+
else {
|
|
16850
|
+
bc = divideLinear(bc, 1 - percent)[1];
|
|
17018
16851
|
}
|
|
17019
|
-
tc.defined = lastDefined;
|
|
17020
|
-
bc.defined = lastDefined;
|
|
17021
|
-
topList.push(tc);
|
|
17022
|
-
bottomList.push(bc);
|
|
17023
16852
|
}
|
|
17024
|
-
tc =
|
|
17025
|
-
bc =
|
|
16853
|
+
tc.defined = lastDefined;
|
|
16854
|
+
bc.defined = lastDefined;
|
|
16855
|
+
topList.push(tc);
|
|
16856
|
+
bottomList.push(bc);
|
|
17026
16857
|
}
|
|
16858
|
+
tc = null;
|
|
16859
|
+
bc = null;
|
|
17027
16860
|
}
|
|
17028
|
-
|
|
17029
|
-
drawAreaConnectBlock(path, topList, bottomList, params);
|
|
17030
|
-
}
|
|
17031
|
-
else {
|
|
17032
|
-
drawAreaBlock(path, topList, bottomList, params);
|
|
17033
|
-
}
|
|
17034
|
-
}
|
|
17035
|
-
function drawAreaConnectBlock(path, topList, bottomList, params) {
|
|
17036
|
-
if (topList.length < 2) {
|
|
17037
|
-
return;
|
|
17038
|
-
}
|
|
17039
|
-
const { offsetX = 0, offsetY = 0, offsetZ = 0, mode } = params || {};
|
|
17040
|
-
let curve = topList[0];
|
|
17041
|
-
path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ);
|
|
17042
|
-
curve = topList[topList.length - 1];
|
|
17043
|
-
let end = curve.p3 || curve.p1;
|
|
17044
|
-
path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ);
|
|
17045
|
-
curve = bottomList[bottomList.length - 1];
|
|
17046
|
-
path.lineTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ);
|
|
17047
|
-
curve = bottomList[0];
|
|
17048
|
-
end = curve.p3 || curve.p1;
|
|
17049
|
-
path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ);
|
|
17050
|
-
path.closePath();
|
|
16861
|
+
drawAreaBlock(path, topList, bottomList, params);
|
|
17051
16862
|
}
|
|
17052
16863
|
function drawAreaBlock(path, topList, bottomList, params) {
|
|
17053
16864
|
const { offsetX = 0, offsetY = 0, offsetZ = 0 } = params || {};
|
|
@@ -17161,7 +16972,7 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17161
16972
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17162
16973
|
var _a, _b, _c, _d, _e, _f;
|
|
17163
16974
|
const areaAttribute = getTheme(area, params === null || params === void 0 ? void 0 : params.theme).area;
|
|
17164
|
-
const { fill = areaAttribute.fill, stroke = areaAttribute.stroke, fillOpacity = areaAttribute.fillOpacity, z = areaAttribute.z, strokeOpacity = areaAttribute.strokeOpacity, curveTension = areaAttribute.curveTension } = area.attribute;
|
|
16975
|
+
const { fill = areaAttribute.fill, stroke = areaAttribute.stroke, fillOpacity = areaAttribute.fillOpacity, z = areaAttribute.z, strokeOpacity = areaAttribute.strokeOpacity, curveTension = areaAttribute.curveTension, connectedType = areaAttribute.connectedType } = area.attribute;
|
|
17165
16976
|
const data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
17166
16977
|
if (!data) {
|
|
17167
16978
|
return;
|
|
@@ -17173,6 +16984,12 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17173
16984
|
if (closePath && curveType === 'linear') {
|
|
17174
16985
|
curveType = 'linearClosed';
|
|
17175
16986
|
}
|
|
16987
|
+
function parsePoint(points, connectedType) {
|
|
16988
|
+
if (connectedType !== 'connect') {
|
|
16989
|
+
return points;
|
|
16990
|
+
}
|
|
16991
|
+
return points.filter(p => p.defined !== false);
|
|
16992
|
+
}
|
|
17176
16993
|
if (clipRange === 1 && !segments && !points.some(p => p.defined === false) && curveType === 'linear') {
|
|
17177
16994
|
return this.drawLinearAreaHighPerformance(area, context, !!fill, doStroke, fillOpacity, strokeOpacity, x, y, areaAttribute, drawContext, params, fillCb, strokeCb);
|
|
17178
16995
|
}
|
|
@@ -17195,7 +17012,7 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17195
17012
|
startPoint.x = lastTopSeg.endX;
|
|
17196
17013
|
startPoint.y = lastTopSeg.endY;
|
|
17197
17014
|
}
|
|
17198
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
17015
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
17199
17016
|
startPoint,
|
|
17200
17017
|
curveTension
|
|
17201
17018
|
});
|
|
@@ -17224,7 +17041,7 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17224
17041
|
});
|
|
17225
17042
|
}
|
|
17226
17043
|
if (bottomPoints.length > 1) {
|
|
17227
|
-
lastBottomSeg = calcLineCache(bottomPoints, curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType, { curveTension });
|
|
17044
|
+
lastBottomSeg = calcLineCache(parsePoint(bottomPoints, connectedType), curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType, { curveTension });
|
|
17228
17045
|
bottomCaches.unshift(lastBottomSeg);
|
|
17229
17046
|
}
|
|
17230
17047
|
}
|
|
@@ -17234,12 +17051,12 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17234
17051
|
}));
|
|
17235
17052
|
}
|
|
17236
17053
|
else if (points && points.length) {
|
|
17237
|
-
const topPoints = points;
|
|
17054
|
+
const topPoints = parsePoint(points, connectedType);
|
|
17238
17055
|
const bottomPoints = [];
|
|
17239
|
-
for (let i =
|
|
17056
|
+
for (let i = topPoints.length - 1; i >= 0; i--) {
|
|
17240
17057
|
bottomPoints.push({
|
|
17241
|
-
x: (_e = points[i].x1) !== null && _e !== void 0 ? _e :
|
|
17242
|
-
y: (_f = points[i].y1) !== null && _f !== void 0 ? _f :
|
|
17058
|
+
x: (_e = points[i].x1) !== null && _e !== void 0 ? _e : topPoints[i].x,
|
|
17059
|
+
y: (_f = points[i].y1) !== null && _f !== void 0 ? _f : topPoints[i].y
|
|
17243
17060
|
});
|
|
17244
17061
|
}
|
|
17245
17062
|
const topCache = calcLineCache(topPoints, curveType, { curveTension });
|
|
@@ -17294,17 +17111,9 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17294
17111
|
this._draw(area, areaAttribute, false, drawContext, params);
|
|
17295
17112
|
}
|
|
17296
17113
|
drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
17297
|
-
|
|
17298
|
-
ret =
|
|
17299
|
-
ret ||
|
|
17300
|
-
this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, false, fillCb, strokeCb);
|
|
17301
|
-
ret =
|
|
17302
|
-
ret ||
|
|
17303
|
-
this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, true, fillCb, strokeCb);
|
|
17304
|
-
return ret;
|
|
17114
|
+
return this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb);
|
|
17305
17115
|
}
|
|
17306
|
-
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext,
|
|
17307
|
-
var _a, _b, _c, _d;
|
|
17116
|
+
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
17308
17117
|
if (!(cache &&
|
|
17309
17118
|
cache.top &&
|
|
17310
17119
|
cache.bottom &&
|
|
@@ -17314,35 +17123,6 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17314
17123
|
cache.bottom.curves.length)) {
|
|
17315
17124
|
return;
|
|
17316
17125
|
}
|
|
17317
|
-
let { connectedType, connectedX, connectedY, connectedStyle } = attribute;
|
|
17318
|
-
const da = [];
|
|
17319
|
-
if (connect) {
|
|
17320
|
-
if (isArray(defaultAttribute)) {
|
|
17321
|
-
connectedType = (_a = connectedType !== null && connectedType !== void 0 ? connectedType : defaultAttribute[0].connectedType) !== null && _a !== void 0 ? _a : defaultAttribute[1].connectedType;
|
|
17322
|
-
connectedX = (_b = connectedX !== null && connectedX !== void 0 ? connectedX : defaultAttribute[0].connectedX) !== null && _b !== void 0 ? _b : defaultAttribute[1].connectedX;
|
|
17323
|
-
connectedY = (_c = connectedY !== null && connectedY !== void 0 ? connectedY : defaultAttribute[0].connectedY) !== null && _c !== void 0 ? _c : defaultAttribute[1].connectedY;
|
|
17324
|
-
connectedStyle = (_d = connectedStyle !== null && connectedStyle !== void 0 ? connectedStyle : defaultAttribute[0].connectedStyle) !== null && _d !== void 0 ? _d : defaultAttribute[1].connectedStyle;
|
|
17325
|
-
}
|
|
17326
|
-
else {
|
|
17327
|
-
connectedType = connectedType !== null && connectedType !== void 0 ? connectedType : defaultAttribute.connectedType;
|
|
17328
|
-
connectedX = connectedX !== null && connectedX !== void 0 ? connectedX : defaultAttribute.connectedX;
|
|
17329
|
-
connectedY = connectedY !== null && connectedY !== void 0 ? connectedY : defaultAttribute.connectedY;
|
|
17330
|
-
connectedStyle = connectedStyle !== null && connectedStyle !== void 0 ? connectedStyle : defaultAttribute.connectedStyle;
|
|
17331
|
-
}
|
|
17332
|
-
if (connectedType !== 'connect' && connectedType !== 'zero') {
|
|
17333
|
-
connectedType = 'none';
|
|
17334
|
-
}
|
|
17335
|
-
if (isArray(defaultAttribute)) {
|
|
17336
|
-
defaultAttribute.forEach(i => da.push(i));
|
|
17337
|
-
}
|
|
17338
|
-
else {
|
|
17339
|
-
da.push(defaultAttribute);
|
|
17340
|
-
}
|
|
17341
|
-
da.push(attribute);
|
|
17342
|
-
}
|
|
17343
|
-
if (connect && connectedType === 'none') {
|
|
17344
|
-
return false;
|
|
17345
|
-
}
|
|
17346
17126
|
context.beginPath();
|
|
17347
17127
|
const ret = false;
|
|
17348
17128
|
const { points, segments } = area.attribute;
|
|
@@ -17377,11 +17157,7 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17377
17157
|
offsetX,
|
|
17378
17158
|
offsetY,
|
|
17379
17159
|
offsetZ,
|
|
17380
|
-
direction
|
|
17381
|
-
drawConnect: connect,
|
|
17382
|
-
mode: connectedType,
|
|
17383
|
-
zeroX: connectedX,
|
|
17384
|
-
zeroY: connectedY
|
|
17160
|
+
direction
|
|
17385
17161
|
});
|
|
17386
17162
|
this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
|
|
17387
17163
|
context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
|
|
@@ -17392,7 +17168,7 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17392
17168
|
fillCb(context, attribute, defaultAttribute);
|
|
17393
17169
|
}
|
|
17394
17170
|
else if (fillOpacity) {
|
|
17395
|
-
context.setCommonStyle(area,
|
|
17171
|
+
context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);
|
|
17396
17172
|
context.fill();
|
|
17397
17173
|
}
|
|
17398
17174
|
}
|
|
@@ -17409,14 +17185,10 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
|
17409
17185
|
drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? 'x' : 'y', {
|
|
17410
17186
|
offsetX,
|
|
17411
17187
|
offsetY,
|
|
17412
|
-
offsetZ
|
|
17413
|
-
drawConnect: connect,
|
|
17414
|
-
mode: connectedType,
|
|
17415
|
-
zeroX: connectedX,
|
|
17416
|
-
zeroY: connectedY
|
|
17188
|
+
offsetZ
|
|
17417
17189
|
});
|
|
17418
17190
|
}
|
|
17419
|
-
context.setStrokeStyle(area,
|
|
17191
|
+
context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);
|
|
17420
17192
|
context.stroke();
|
|
17421
17193
|
}
|
|
17422
17194
|
}
|
|
@@ -20771,7 +20543,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
20771
20543
|
const { points = lineTheme.points, connectedType } = attribute;
|
|
20772
20544
|
const b = aabbBounds;
|
|
20773
20545
|
points.forEach(p => {
|
|
20774
|
-
if (p.defined !== false || connectedType === '
|
|
20546
|
+
if (p.defined !== false || connectedType === 'connect') {
|
|
20775
20547
|
b.add(p.x, p.y);
|
|
20776
20548
|
}
|
|
20777
20549
|
});
|
|
@@ -20782,7 +20554,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
20782
20554
|
const b = aabbBounds;
|
|
20783
20555
|
segments.forEach(s => {
|
|
20784
20556
|
s.points.forEach(p => {
|
|
20785
|
-
if (p.defined !== false || connectedType === '
|
|
20557
|
+
if (p.defined !== false || connectedType === 'connect') {
|
|
20786
20558
|
b.add(p.x, p.y);
|
|
20787
20559
|
}
|
|
20788
20560
|
});
|
package/es/animate/animate.js
CHANGED
|
@@ -56,9 +56,10 @@ export class CbAnimate extends ACustomAnimate {
|
|
|
56
56
|
|
|
57
57
|
export class Animate {
|
|
58
58
|
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
59
|
-
this.id = id, this.timeline = timeline, this.status = AnimateStatus.INITIAL,
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
59
|
+
this.id = id, this.timeline = timeline || defaultTimeline, this.status = AnimateStatus.INITIAL,
|
|
60
|
+
this.tailAnimate = new SubAnimate(this), this.subAnimates = [ this.tailAnimate ],
|
|
61
|
+
this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0,
|
|
62
|
+
this.timeline.addAnimate(this), this.slience = slience;
|
|
62
63
|
}
|
|
63
64
|
setTimeline(timeline) {
|
|
64
65
|
timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
|