@visactor/vrender 0.21.2-vstory.1 → 0.21.2-vstory.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +91 -67
- package/dist/index.js +91 -67
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4201,7 +4201,8 @@
|
|
|
4201
4201
|
justifyContent: "flex-start",
|
|
4202
4202
|
alignItems: "flex-start",
|
|
4203
4203
|
alignContent: "flex-start",
|
|
4204
|
-
baseOpacity: 1
|
|
4204
|
+
baseOpacity: 1,
|
|
4205
|
+
cornerType: "round"
|
|
4205
4206
|
});
|
|
4206
4207
|
const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4207
4208
|
path: "",
|
|
@@ -4238,7 +4239,8 @@
|
|
|
4238
4239
|
x1: 0,
|
|
4239
4240
|
y1: 0,
|
|
4240
4241
|
strokeBoundsBuffer: 0,
|
|
4241
|
-
cornerRadius: 0
|
|
4242
|
+
cornerRadius: 0,
|
|
4243
|
+
cornerType: "round"
|
|
4242
4244
|
});
|
|
4243
4245
|
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4244
4246
|
width: 0,
|
|
@@ -4246,7 +4248,8 @@
|
|
|
4246
4248
|
x1: 0,
|
|
4247
4249
|
y1: 0,
|
|
4248
4250
|
cornerRadius: 0,
|
|
4249
|
-
length: 0
|
|
4251
|
+
length: 0,
|
|
4252
|
+
cornerType: "round"
|
|
4250
4253
|
});
|
|
4251
4254
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4252
4255
|
symbolType: "circle",
|
|
@@ -4282,7 +4285,8 @@
|
|
|
4282
4285
|
height: 0
|
|
4283
4286
|
}, DefaultAttribute), {
|
|
4284
4287
|
fill: !0,
|
|
4285
|
-
cornerRadius: 0
|
|
4288
|
+
cornerRadius: 0,
|
|
4289
|
+
cornerType: "round"
|
|
4286
4290
|
});
|
|
4287
4291
|
const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
|
|
4288
4292
|
backgroundShowMode: "never",
|
|
@@ -7241,6 +7245,13 @@
|
|
|
7241
7245
|
Easing[name] = func;
|
|
7242
7246
|
}
|
|
7243
7247
|
}
|
|
7248
|
+
function flicker(t, n) {
|
|
7249
|
+
const step = 1 / n;
|
|
7250
|
+
let flag = 1;
|
|
7251
|
+
for (; t > step;) t -= step, flag *= -1;
|
|
7252
|
+
const v = flag * t / step;
|
|
7253
|
+
return v > 0 ? v : 1 + v;
|
|
7254
|
+
}
|
|
7244
7255
|
Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing.quadInOut = Easing.getPowInOut(2), Easing.cubicIn = Easing.getPowIn(3), Easing.cubicOut = Easing.getPowOut(3), Easing.cubicInOut = Easing.getPowInOut(3), Easing.quartIn = Easing.getPowIn(4), Easing.quartOut = Easing.getPowOut(4), Easing.quartInOut = Easing.getPowInOut(4), Easing.quintIn = Easing.getPowIn(5), Easing.quintOut = Easing.getPowOut(5), Easing.quintInOut = Easing.getPowInOut(5), Easing.backIn = Easing.getBackIn(1.7), Easing.backOut = Easing.getBackOut(1.7), Easing.backInOut = Easing.getBackInOut(1.7), Easing.elasticIn = Easing.getElasticIn(1, .3), Easing.elasticOut = Easing.getElasticOut(1, .3), Easing.elasticInOut = Easing.getElasticInOut(1, .3 * 1.5), Easing.easeInOutQuad = t => (t /= .5) < 1 ? .5 * Math.pow(t, 2) : -.5 * ((t -= 2) * t - 2), Easing.easeOutElastic = x => {
|
|
7245
7256
|
const c4 = 2 * Math.PI / 3;
|
|
7246
7257
|
return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
|
|
@@ -7248,6 +7259,8 @@
|
|
|
7248
7259
|
const c5 = 2 * Math.PI / 4.5;
|
|
7249
7260
|
return 0 === x ? 0 : 1 === x ? 1 : x < .5 ? -Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1;
|
|
7250
7261
|
};
|
|
7262
|
+
for (let i = 0; i < 10; i++) Easing[`flicker${i}`] = t => flicker(t, i);
|
|
7263
|
+
for (let i = 2; i < 10; i++) Easing[`aIn${i}`] = t => i * t * t + (1 - i) * t;
|
|
7251
7264
|
|
|
7252
7265
|
class DefaultTimeline {
|
|
7253
7266
|
constructor() {
|
|
@@ -7929,39 +7942,25 @@
|
|
|
7929
7942
|
};
|
|
7930
7943
|
}
|
|
7931
7944
|
onBind() {
|
|
7932
|
-
var _a, _b, _c
|
|
7933
|
-
|
|
7934
|
-
this.toText = this.toText.toString();
|
|
7935
|
-
const root = this.target.attachShadow(),
|
|
7936
|
-
line = application.graphicService.creator.line({
|
|
7937
|
-
x: 0,
|
|
7938
|
-
y: 0,
|
|
7939
|
-
points: [{
|
|
7940
|
-
x: 0,
|
|
7941
|
-
y: 0
|
|
7942
|
-
}, {
|
|
7943
|
-
x: 0,
|
|
7944
|
-
y: this.target.getComputedAttribute("fontSize")
|
|
7945
|
-
}],
|
|
7946
|
-
stroke: "black",
|
|
7947
|
-
lineWidth: 1
|
|
7948
|
-
});
|
|
7949
|
-
root.add(line);
|
|
7950
|
-
}
|
|
7945
|
+
var _a, _b, _c;
|
|
7946
|
+
this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "", this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "", (!this.toText || isArray$1(this.toText) && 0 === this.toText.length) && (this.valid = !1), isArray$1(this.toText) && (this.toText = this.toText.map(item => (item || "").toString()));
|
|
7951
7947
|
}
|
|
7952
7948
|
onEnd() {
|
|
7953
7949
|
this.target.detachShadow();
|
|
7954
7950
|
}
|
|
7955
7951
|
onUpdate(end, ratio, out) {
|
|
7956
|
-
var _a;
|
|
7957
7952
|
if (!1 === this.valid) return;
|
|
7958
7953
|
const fromCount = this.fromText.length,
|
|
7959
|
-
|
|
7954
|
+
toTextIsArray = isArray$1(this.toText),
|
|
7955
|
+
toCount = toTextIsArray ? this.toText.reduce((c, t) => c + (t || "").length, 0) : this.toText.length,
|
|
7960
7956
|
count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7957
|
+
if (toTextIsArray) {
|
|
7958
|
+
out.text = [];
|
|
7959
|
+
let len = 0;
|
|
7960
|
+
this.toText.forEach(t => {
|
|
7961
|
+
len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
|
|
7962
|
+
});
|
|
7963
|
+
} else out.text = this.toText.substr(0, count);
|
|
7965
7964
|
}
|
|
7966
7965
|
}
|
|
7967
7966
|
class StreamLight extends ACustomAnimate {
|
|
@@ -10348,6 +10347,20 @@
|
|
|
10348
10347
|
});
|
|
10349
10348
|
return color && (nextAttributes[key] = color), !0;
|
|
10350
10349
|
}
|
|
10350
|
+
if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
10351
|
+
const nextList = [];
|
|
10352
|
+
let valid = !0;
|
|
10353
|
+
for (let i = 0; i < nextStepVal.length; i++) {
|
|
10354
|
+
const v = lastStepVal[i],
|
|
10355
|
+
val = v + (nextStepVal[i] - v) * ratio;
|
|
10356
|
+
if (!Number.isFinite(val)) {
|
|
10357
|
+
valid = !1;
|
|
10358
|
+
break;
|
|
10359
|
+
}
|
|
10360
|
+
nextList.push(val);
|
|
10361
|
+
}
|
|
10362
|
+
valid && (nextAttributes[key] = nextList);
|
|
10363
|
+
}
|
|
10351
10364
|
return !1;
|
|
10352
10365
|
}
|
|
10353
10366
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
|
|
@@ -15607,7 +15620,7 @@
|
|
|
15607
15620
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
15608
15621
|
|
|
15609
15622
|
const halfPi = pi / 2;
|
|
15610
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
15623
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
|
|
15611
15624
|
let cornerRadius;
|
|
15612
15625
|
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
15613
15626
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -15639,27 +15652,29 @@
|
|
|
15639
15652
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
15640
15653
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
15641
15654
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
15642
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]),
|
|
15643
|
-
edgeCb && edgeCb[0]
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
15648
|
-
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
|
|
15658
|
-
|
|
15659
|
-
|
|
15660
|
-
|
|
15661
|
-
|
|
15662
|
-
|
|
15655
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
|
|
15656
|
+
if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
15657
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
15658
|
+
const centerX = rightTopPoint1[0],
|
|
15659
|
+
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
15660
|
+
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
15661
|
+
}
|
|
15662
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
15663
|
+
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
15664
|
+
centerY = rightBottomPoint2[1];
|
|
15665
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
15666
|
+
}
|
|
15667
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
15668
|
+
const centerX = leftBottomPoint1[0],
|
|
15669
|
+
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
15670
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
15671
|
+
}
|
|
15672
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
15673
|
+
const centerX = leftTopPoint1[0],
|
|
15674
|
+
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
15675
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
15676
|
+
}
|
|
15677
|
+
} else edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint1[0], rightTopPoint1[1], rightBottomPoint1[0], rightBottomPoint1[1]) : path.lineTo(rightBottomPoint1[0], rightBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](leftBottomPoint1[0], leftBottomPoint1[1], leftTopPoint1[0], leftTopPoint1[1]) : path.lineTo(leftTopPoint1[0], leftTopPoint1[1]);
|
|
15663
15678
|
return !edgeCb && path.closePath(), path;
|
|
15664
15679
|
}
|
|
15665
15680
|
|
|
@@ -15684,6 +15699,7 @@
|
|
|
15684
15699
|
if (!doOuterBorder && !doInnerBorder) return;
|
|
15685
15700
|
const {
|
|
15686
15701
|
cornerRadius = rectAttribute.cornerRadius,
|
|
15702
|
+
cornerType = rectAttribute.cornerType,
|
|
15687
15703
|
opacity = rectAttribute.opacity,
|
|
15688
15704
|
x: originX = rectAttribute.x,
|
|
15689
15705
|
y: originY = rectAttribute.y,
|
|
@@ -15708,7 +15724,7 @@
|
|
|
15708
15724
|
nextX = x + sign * d,
|
|
15709
15725
|
nextY = y + sign * d,
|
|
15710
15726
|
dw = 2 * d;
|
|
15711
|
-
if (0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
|
|
15727
|
+
if (0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius, "round" === cornerType)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
|
|
15712
15728
|
const lastOpacity = rectAttribute[key].opacity;
|
|
15713
15729
|
rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
|
|
15714
15730
|
}
|
|
@@ -15739,7 +15755,8 @@
|
|
|
15739
15755
|
x: originX = groupAttribute.x,
|
|
15740
15756
|
y: originY = groupAttribute.y,
|
|
15741
15757
|
stroke = groupAttribute.stroke,
|
|
15742
|
-
cornerRadius = groupAttribute.cornerRadius
|
|
15758
|
+
cornerRadius = groupAttribute.cornerRadius,
|
|
15759
|
+
cornerType = groupAttribute.cornerType
|
|
15743
15760
|
} = rect.attribute;
|
|
15744
15761
|
let {
|
|
15745
15762
|
width: width,
|
|
@@ -15749,7 +15766,7 @@
|
|
|
15749
15766
|
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
15750
15767
|
let lastStroke,
|
|
15751
15768
|
lastStrokeI = 0;
|
|
15752
|
-
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15769
|
+
return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15753
15770
|
stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
|
|
15754
15771
|
stroke: stroke[i]
|
|
15755
15772
|
}), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
|
|
@@ -15808,7 +15825,7 @@
|
|
|
15808
15825
|
width: width,
|
|
15809
15826
|
height: height
|
|
15810
15827
|
} = getActualPosition(graphic);
|
|
15811
|
-
cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
15828
|
+
cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius, !0) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
15812
15829
|
} else {
|
|
15813
15830
|
context.beginPath();
|
|
15814
15831
|
const b = graphic.AABBBounds;
|
|
@@ -16912,6 +16929,7 @@
|
|
|
16912
16929
|
background: background,
|
|
16913
16930
|
stroke = rectAttribute.stroke,
|
|
16914
16931
|
cornerRadius = rectAttribute.cornerRadius,
|
|
16932
|
+
cornerType = rectAttribute.cornerType,
|
|
16915
16933
|
opacity = rectAttribute.opacity,
|
|
16916
16934
|
fillOpacity = rectAttribute.fillOpacity,
|
|
16917
16935
|
lineWidth = rectAttribute.lineWidth,
|
|
@@ -16935,7 +16953,7 @@
|
|
|
16935
16953
|
if (!rect.valid || !visible) return;
|
|
16936
16954
|
if (!doFill && !doStroke) return;
|
|
16937
16955
|
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
16938
|
-
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
16956
|
+
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
|
|
16939
16957
|
const doFillOrStroke = {
|
|
16940
16958
|
doFill: doFill,
|
|
16941
16959
|
doStroke: doStroke
|
|
@@ -17113,7 +17131,7 @@
|
|
|
17113
17131
|
const {
|
|
17114
17132
|
backgroundCornerRadius: backgroundCornerRadius
|
|
17115
17133
|
} = graphic.attribute;
|
|
17116
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
17134
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), 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();
|
|
17117
17135
|
}
|
|
17118
17136
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
17119
17137
|
}
|
|
@@ -17424,6 +17442,7 @@
|
|
|
17424
17442
|
lineWidth = groupAttribute.lineWidth,
|
|
17425
17443
|
visible = groupAttribute.visible,
|
|
17426
17444
|
fillStrokeOrder = groupAttribute.fillStrokeOrder,
|
|
17445
|
+
cornerType = groupAttribute.cornerType,
|
|
17427
17446
|
x: originX = groupAttribute.x,
|
|
17428
17447
|
y: originY = groupAttribute.y
|
|
17429
17448
|
} = group.attribute,
|
|
@@ -17443,7 +17462,7 @@
|
|
|
17443
17462
|
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
17444
17463
|
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
17445
17464
|
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
17446
|
-
} else 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
17465
|
+
} else 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
|
|
17447
17466
|
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
17448
17467
|
const doFillOrStroke = {
|
|
17449
17468
|
doFill: doFill,
|
|
@@ -17525,6 +17544,7 @@
|
|
|
17525
17544
|
y: originY = imageAttribute.y,
|
|
17526
17545
|
cornerRadius = imageAttribute.cornerRadius,
|
|
17527
17546
|
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
17547
|
+
cornerType = imageAttribute.cornerType,
|
|
17528
17548
|
image: url
|
|
17529
17549
|
} = image.attribute,
|
|
17530
17550
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -17542,7 +17562,7 @@
|
|
|
17542
17562
|
const res = image.resources.get(url);
|
|
17543
17563
|
if ("success" !== res.state) return;
|
|
17544
17564
|
let needRestore = !1;
|
|
17545
|
-
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
17565
|
+
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
17546
17566
|
let repeat = 0;
|
|
17547
17567
|
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
17548
17568
|
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
@@ -20934,7 +20954,7 @@
|
|
|
20934
20954
|
if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
|
|
20935
20955
|
const expandX = (backgroundWidth - width) / 2,
|
|
20936
20956
|
expandY = (backgroundHeight - height) / 2;
|
|
20937
|
-
0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
|
|
20957
|
+
0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, !0)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
|
|
20938
20958
|
}
|
|
20939
20959
|
const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
|
|
20940
20960
|
res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
|
|
@@ -24944,11 +24964,12 @@
|
|
|
24944
24964
|
stroke = defaultParams.stroke,
|
|
24945
24965
|
lineJoin = defaultParams.lineJoin,
|
|
24946
24966
|
lineDash = defaultParams.lineDash,
|
|
24967
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
24947
24968
|
lineCap = defaultParams.lineCap,
|
|
24948
24969
|
miterLimit = defaultParams.miterLimit,
|
|
24949
24970
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
24950
24971
|
} = attribute;
|
|
24951
|
-
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24972
|
+
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24952
24973
|
}
|
|
24953
24974
|
}
|
|
24954
24975
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -26440,9 +26461,10 @@
|
|
|
26440
26461
|
lineDash = defaultParams.lineDash,
|
|
26441
26462
|
lineCap = defaultParams.lineCap,
|
|
26442
26463
|
miterLimit = defaultParams.miterLimit,
|
|
26443
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26464
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
26465
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
26444
26466
|
} = attribute;
|
|
26445
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash
|
|
26467
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || !lineDash || (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
26446
26468
|
}
|
|
26447
26469
|
}
|
|
26448
26470
|
measureText(text) {
|
|
@@ -27069,11 +27091,12 @@
|
|
|
27069
27091
|
stroke = defaultParams.stroke,
|
|
27070
27092
|
lineJoin = defaultParams.lineJoin,
|
|
27071
27093
|
lineDash = defaultParams.lineDash,
|
|
27094
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
27072
27095
|
lineCap = defaultParams.lineCap,
|
|
27073
27096
|
miterLimit = defaultParams.miterLimit,
|
|
27074
27097
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27075
27098
|
} = attribute;
|
|
27076
|
-
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
27099
|
+
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
27077
27100
|
}
|
|
27078
27101
|
}
|
|
27079
27102
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -28114,9 +28137,10 @@
|
|
|
28114
28137
|
lineDash = defaultParams.lineDash,
|
|
28115
28138
|
lineCap = defaultParams.lineCap,
|
|
28116
28139
|
miterLimit = defaultParams.miterLimit,
|
|
28117
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
28140
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
28141
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
28118
28142
|
} = attribute;
|
|
28119
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
28143
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || (lineDash && _context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
28120
28144
|
}
|
|
28121
28145
|
}
|
|
28122
28146
|
measureText(text) {
|
|
@@ -29890,7 +29914,7 @@
|
|
|
29890
29914
|
|
|
29891
29915
|
const roughModule = _roughModule;
|
|
29892
29916
|
|
|
29893
|
-
const version = "0.21.2-vstory.
|
|
29917
|
+
const version = "0.21.2-vstory.2";
|
|
29894
29918
|
preLoadAllModule();
|
|
29895
29919
|
if (isBrowserEnv()) {
|
|
29896
29920
|
loadBrowserEnv(container);
|