@visactor/vrender 0.21.5-vstory.1 → 0.21.5-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
|
@@ -4231,7 +4231,8 @@
|
|
|
4231
4231
|
justifyContent: "flex-start",
|
|
4232
4232
|
alignItems: "flex-start",
|
|
4233
4233
|
alignContent: "flex-start",
|
|
4234
|
-
baseOpacity: 1
|
|
4234
|
+
baseOpacity: 1,
|
|
4235
|
+
cornerType: "round"
|
|
4235
4236
|
});
|
|
4236
4237
|
const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4237
4238
|
path: "",
|
|
@@ -4268,7 +4269,8 @@
|
|
|
4268
4269
|
x1: 0,
|
|
4269
4270
|
y1: 0,
|
|
4270
4271
|
strokeBoundsBuffer: 0,
|
|
4271
|
-
cornerRadius: 0
|
|
4272
|
+
cornerRadius: 0,
|
|
4273
|
+
cornerType: "round"
|
|
4272
4274
|
});
|
|
4273
4275
|
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4274
4276
|
width: 0,
|
|
@@ -4276,7 +4278,8 @@
|
|
|
4276
4278
|
x1: 0,
|
|
4277
4279
|
y1: 0,
|
|
4278
4280
|
cornerRadius: 0,
|
|
4279
|
-
length: 0
|
|
4281
|
+
length: 0,
|
|
4282
|
+
cornerType: "round"
|
|
4280
4283
|
});
|
|
4281
4284
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4282
4285
|
symbolType: "circle",
|
|
@@ -4312,7 +4315,8 @@
|
|
|
4312
4315
|
height: 0
|
|
4313
4316
|
}, DefaultAttribute), {
|
|
4314
4317
|
fill: !0,
|
|
4315
|
-
cornerRadius: 0
|
|
4318
|
+
cornerRadius: 0,
|
|
4319
|
+
cornerType: "round"
|
|
4316
4320
|
});
|
|
4317
4321
|
const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
|
|
4318
4322
|
backgroundShowMode: "never",
|
|
@@ -7271,6 +7275,13 @@
|
|
|
7271
7275
|
Easing[name] = func;
|
|
7272
7276
|
}
|
|
7273
7277
|
}
|
|
7278
|
+
function flicker(t, n) {
|
|
7279
|
+
const step = 1 / n;
|
|
7280
|
+
let flag = 1;
|
|
7281
|
+
for (; t > step;) t -= step, flag *= -1;
|
|
7282
|
+
const v = flag * t / step;
|
|
7283
|
+
return v > 0 ? v : 1 + v;
|
|
7284
|
+
}
|
|
7274
7285
|
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 => {
|
|
7275
7286
|
const c4 = 2 * Math.PI / 3;
|
|
7276
7287
|
return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
|
|
@@ -7278,6 +7289,8 @@
|
|
|
7278
7289
|
const c5 = 2 * Math.PI / 4.5;
|
|
7279
7290
|
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;
|
|
7280
7291
|
};
|
|
7292
|
+
for (let i = 0; i < 10; i++) Easing[`flicker${i}`] = t => flicker(t, i);
|
|
7293
|
+
for (let i = 2; i < 10; i++) Easing[`aIn${i}`] = t => i * t * t + (1 - i) * t;
|
|
7281
7294
|
|
|
7282
7295
|
class DefaultTimeline {
|
|
7283
7296
|
constructor() {
|
|
@@ -7959,39 +7972,25 @@
|
|
|
7959
7972
|
};
|
|
7960
7973
|
}
|
|
7961
7974
|
onBind() {
|
|
7962
|
-
var _a, _b, _c
|
|
7963
|
-
|
|
7964
|
-
this.toText = this.toText.toString();
|
|
7965
|
-
const root = this.target.attachShadow(),
|
|
7966
|
-
line = application.graphicService.creator.line({
|
|
7967
|
-
x: 0,
|
|
7968
|
-
y: 0,
|
|
7969
|
-
points: [{
|
|
7970
|
-
x: 0,
|
|
7971
|
-
y: 0
|
|
7972
|
-
}, {
|
|
7973
|
-
x: 0,
|
|
7974
|
-
y: this.target.getComputedAttribute("fontSize")
|
|
7975
|
-
}],
|
|
7976
|
-
stroke: "black",
|
|
7977
|
-
lineWidth: 1
|
|
7978
|
-
});
|
|
7979
|
-
root.add(line);
|
|
7980
|
-
}
|
|
7975
|
+
var _a, _b, _c;
|
|
7976
|
+
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()));
|
|
7981
7977
|
}
|
|
7982
7978
|
onEnd() {
|
|
7983
7979
|
this.target.detachShadow();
|
|
7984
7980
|
}
|
|
7985
7981
|
onUpdate(end, ratio, out) {
|
|
7986
|
-
var _a;
|
|
7987
7982
|
if (!1 === this.valid) return;
|
|
7988
7983
|
const fromCount = this.fromText.length,
|
|
7989
|
-
|
|
7984
|
+
toTextIsArray = isArray$1(this.toText),
|
|
7985
|
+
toCount = toTextIsArray ? this.toText.reduce((c, t) => c + (t || "").length, 0) : this.toText.length,
|
|
7990
7986
|
count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7987
|
+
if (toTextIsArray) {
|
|
7988
|
+
out.text = [];
|
|
7989
|
+
let len = 0;
|
|
7990
|
+
this.toText.forEach(t => {
|
|
7991
|
+
len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
|
|
7992
|
+
});
|
|
7993
|
+
} else out.text = this.toText.substr(0, count);
|
|
7995
7994
|
}
|
|
7996
7995
|
}
|
|
7997
7996
|
class StreamLight extends ACustomAnimate {
|
|
@@ -10378,6 +10377,20 @@
|
|
|
10378
10377
|
});
|
|
10379
10378
|
return color && (nextAttributes[key] = color), !0;
|
|
10380
10379
|
}
|
|
10380
|
+
if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
10381
|
+
const nextList = [];
|
|
10382
|
+
let valid = !0;
|
|
10383
|
+
for (let i = 0; i < nextStepVal.length; i++) {
|
|
10384
|
+
const v = lastStepVal[i],
|
|
10385
|
+
val = v + (nextStepVal[i] - v) * ratio;
|
|
10386
|
+
if (!Number.isFinite(val)) {
|
|
10387
|
+
valid = !1;
|
|
10388
|
+
break;
|
|
10389
|
+
}
|
|
10390
|
+
nextList.push(val);
|
|
10391
|
+
}
|
|
10392
|
+
valid && (nextAttributes[key] = nextList);
|
|
10393
|
+
}
|
|
10381
10394
|
return !1;
|
|
10382
10395
|
}
|
|
10383
10396
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
|
|
@@ -15637,7 +15650,7 @@
|
|
|
15637
15650
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
15638
15651
|
|
|
15639
15652
|
const halfPi = pi / 2;
|
|
15640
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
15653
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
|
|
15641
15654
|
let cornerRadius;
|
|
15642
15655
|
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)) {
|
|
15643
15656
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -15669,27 +15682,29 @@
|
|
|
15669
15682
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
15670
15683
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
15671
15684
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
15672
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]),
|
|
15673
|
-
edgeCb && edgeCb[0]
|
|
15674
|
-
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15683
|
-
|
|
15684
|
-
|
|
15685
|
-
|
|
15686
|
-
|
|
15687
|
-
|
|
15688
|
-
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15685
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
|
|
15686
|
+
if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
15687
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
15688
|
+
const centerX = rightTopPoint1[0],
|
|
15689
|
+
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
15690
|
+
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
15691
|
+
}
|
|
15692
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
15693
|
+
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
15694
|
+
centerY = rightBottomPoint2[1];
|
|
15695
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
15696
|
+
}
|
|
15697
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
15698
|
+
const centerX = leftBottomPoint1[0],
|
|
15699
|
+
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
15700
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
15701
|
+
}
|
|
15702
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
15703
|
+
const centerX = leftTopPoint1[0],
|
|
15704
|
+
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
15705
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
15706
|
+
}
|
|
15707
|
+
} 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]);
|
|
15693
15708
|
return !edgeCb && path.closePath(), path;
|
|
15694
15709
|
}
|
|
15695
15710
|
|
|
@@ -15714,6 +15729,7 @@
|
|
|
15714
15729
|
if (!doOuterBorder && !doInnerBorder) return;
|
|
15715
15730
|
const {
|
|
15716
15731
|
cornerRadius = rectAttribute.cornerRadius,
|
|
15732
|
+
cornerType = rectAttribute.cornerType,
|
|
15717
15733
|
opacity = rectAttribute.opacity,
|
|
15718
15734
|
x: originX = rectAttribute.x,
|
|
15719
15735
|
y: originY = rectAttribute.y,
|
|
@@ -15738,7 +15754,7 @@
|
|
|
15738
15754
|
nextX = x + sign * d,
|
|
15739
15755
|
nextY = y + sign * d,
|
|
15740
15756
|
dw = 2 * d;
|
|
15741
|
-
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) {
|
|
15757
|
+
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) {
|
|
15742
15758
|
const lastOpacity = rectAttribute[key].opacity;
|
|
15743
15759
|
rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
|
|
15744
15760
|
}
|
|
@@ -15769,7 +15785,8 @@
|
|
|
15769
15785
|
x: originX = groupAttribute.x,
|
|
15770
15786
|
y: originY = groupAttribute.y,
|
|
15771
15787
|
stroke = groupAttribute.stroke,
|
|
15772
|
-
cornerRadius = groupAttribute.cornerRadius
|
|
15788
|
+
cornerRadius = groupAttribute.cornerRadius,
|
|
15789
|
+
cornerType = groupAttribute.cornerType
|
|
15773
15790
|
} = rect.attribute;
|
|
15774
15791
|
let {
|
|
15775
15792
|
width: width,
|
|
@@ -15779,7 +15796,7 @@
|
|
|
15779
15796
|
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
15780
15797
|
let lastStroke,
|
|
15781
15798
|
lastStrokeI = 0;
|
|
15782
|
-
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15799
|
+
return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15783
15800
|
stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
|
|
15784
15801
|
stroke: stroke[i]
|
|
15785
15802
|
}), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
|
|
@@ -15840,7 +15857,7 @@
|
|
|
15840
15857
|
width: width,
|
|
15841
15858
|
height: height
|
|
15842
15859
|
} = getActualPosition(graphic);
|
|
15843
|
-
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());
|
|
15860
|
+
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());
|
|
15844
15861
|
} else context.beginPath(), context.rect(x, y, width || 0, height || 0), context.fillStyle = background, context.globalAlpha = 1, context.fill();
|
|
15845
15862
|
}
|
|
15846
15863
|
}
|
|
@@ -16940,6 +16957,7 @@
|
|
|
16940
16957
|
background: background,
|
|
16941
16958
|
stroke = rectAttribute.stroke,
|
|
16942
16959
|
cornerRadius = rectAttribute.cornerRadius,
|
|
16960
|
+
cornerType = rectAttribute.cornerType,
|
|
16943
16961
|
opacity = rectAttribute.opacity,
|
|
16944
16962
|
fillOpacity = rectAttribute.fillOpacity,
|
|
16945
16963
|
lineWidth = rectAttribute.lineWidth,
|
|
@@ -16963,7 +16981,7 @@
|
|
|
16963
16981
|
if (!rect.valid || !visible) return;
|
|
16964
16982
|
if (!doFill && !doStroke) return;
|
|
16965
16983
|
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
16966
|
-
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));
|
|
16984
|
+
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));
|
|
16967
16985
|
const doFillOrStroke = {
|
|
16968
16986
|
doFill: doFill,
|
|
16969
16987
|
doStroke: doStroke
|
|
@@ -17141,7 +17159,7 @@
|
|
|
17141
17159
|
const {
|
|
17142
17160
|
backgroundCornerRadius: backgroundCornerRadius
|
|
17143
17161
|
} = graphic.attribute;
|
|
17144
|
-
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();
|
|
17162
|
+
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();
|
|
17145
17163
|
}
|
|
17146
17164
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
17147
17165
|
}
|
|
@@ -17452,6 +17470,7 @@
|
|
|
17452
17470
|
lineWidth = groupAttribute.lineWidth,
|
|
17453
17471
|
visible = groupAttribute.visible,
|
|
17454
17472
|
fillStrokeOrder = groupAttribute.fillStrokeOrder,
|
|
17473
|
+
cornerType = groupAttribute.cornerType,
|
|
17455
17474
|
x: originX = groupAttribute.x,
|
|
17456
17475
|
y: originY = groupAttribute.y
|
|
17457
17476
|
} = group.attribute,
|
|
@@ -17471,7 +17490,7 @@
|
|
|
17471
17490
|
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
17472
17491
|
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
17473
17492
|
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
17474
|
-
} 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));
|
|
17493
|
+
} 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));
|
|
17475
17494
|
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
17476
17495
|
const doFillOrStroke = {
|
|
17477
17496
|
doFill: doFill,
|
|
@@ -17553,6 +17572,7 @@
|
|
|
17553
17572
|
y: originY = imageAttribute.y,
|
|
17554
17573
|
cornerRadius = imageAttribute.cornerRadius,
|
|
17555
17574
|
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
17575
|
+
cornerType = imageAttribute.cornerType,
|
|
17556
17576
|
image: url
|
|
17557
17577
|
} = image.attribute,
|
|
17558
17578
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -17570,7 +17590,7 @@
|
|
|
17570
17590
|
const res = image.resources.get(url);
|
|
17571
17591
|
if ("success" !== res.state) return;
|
|
17572
17592
|
let needRestore = !1;
|
|
17573
|
-
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);
|
|
17593
|
+
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);
|
|
17574
17594
|
let repeat = 0;
|
|
17575
17595
|
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
17576
17596
|
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
@@ -20991,7 +21011,7 @@
|
|
|
20991
21011
|
if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
|
|
20992
21012
|
const expandX = (backgroundWidth - width) / 2,
|
|
20993
21013
|
expandY = (backgroundHeight - height) / 2;
|
|
20994
|
-
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());
|
|
21014
|
+
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());
|
|
20995
21015
|
}
|
|
20996
21016
|
const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
|
|
20997
21017
|
res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
|
|
@@ -25015,11 +25035,12 @@
|
|
|
25015
25035
|
stroke = defaultParams.stroke,
|
|
25016
25036
|
lineJoin = defaultParams.lineJoin,
|
|
25017
25037
|
lineDash = defaultParams.lineDash,
|
|
25038
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
25018
25039
|
lineCap = defaultParams.lineCap,
|
|
25019
25040
|
miterLimit = defaultParams.miterLimit,
|
|
25020
25041
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
25021
25042
|
} = attribute;
|
|
25022
|
-
_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;
|
|
25043
|
+
_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;
|
|
25023
25044
|
}
|
|
25024
25045
|
}
|
|
25025
25046
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -26549,9 +26570,10 @@
|
|
|
26549
26570
|
lineDash = defaultParams.lineDash,
|
|
26550
26571
|
lineCap = defaultParams.lineCap,
|
|
26551
26572
|
miterLimit = defaultParams.miterLimit,
|
|
26552
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26573
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
26574
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
26553
26575
|
} = attribute;
|
|
26554
|
-
_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
|
|
26576
|
+
_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;
|
|
26555
26577
|
}
|
|
26556
26578
|
}
|
|
26557
26579
|
measureText(text) {
|
|
@@ -27178,11 +27200,12 @@
|
|
|
27178
27200
|
stroke = defaultParams.stroke,
|
|
27179
27201
|
lineJoin = defaultParams.lineJoin,
|
|
27180
27202
|
lineDash = defaultParams.lineDash,
|
|
27203
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
27181
27204
|
lineCap = defaultParams.lineCap,
|
|
27182
27205
|
miterLimit = defaultParams.miterLimit,
|
|
27183
27206
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27184
27207
|
} = attribute;
|
|
27185
|
-
_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);
|
|
27208
|
+
_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);
|
|
27186
27209
|
}
|
|
27187
27210
|
}
|
|
27188
27211
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -28223,9 +28246,10 @@
|
|
|
28223
28246
|
lineDash = defaultParams.lineDash,
|
|
28224
28247
|
lineCap = defaultParams.lineCap,
|
|
28225
28248
|
miterLimit = defaultParams.miterLimit,
|
|
28226
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
28249
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
28250
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
28227
28251
|
} = attribute;
|
|
28228
|
-
_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;
|
|
28252
|
+
_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;
|
|
28229
28253
|
}
|
|
28230
28254
|
}
|
|
28231
28255
|
measureText(text) {
|
|
@@ -29999,7 +30023,7 @@
|
|
|
29999
30023
|
|
|
30000
30024
|
const roughModule = _roughModule;
|
|
30001
30025
|
|
|
30002
|
-
const version = "0.21.5-vstory.
|
|
30026
|
+
const version = "0.21.5-vstory.2";
|
|
30003
30027
|
preLoadAllModule();
|
|
30004
30028
|
if (isBrowserEnv()) {
|
|
30005
30029
|
loadBrowserEnv(container);
|