@leafer-ui/miniapp 2.1.5 → 2.1.6
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/dist/miniapp.cjs +6 -4
- package/dist/miniapp.esm.js +6 -4
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +17 -8
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +10 -10
package/dist/miniapp.module.js
CHANGED
|
@@ -3722,7 +3722,7 @@ const {arcTo: arcTo} = PathCommandDataHelper;
|
|
|
3722
3722
|
|
|
3723
3723
|
const PathCorner = {
|
|
3724
3724
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3725
|
-
let command, lastCommand, commandLen;
|
|
3725
|
+
let command, lastCommand, commandLen, startXIndex, startYIndex, smoothLen;
|
|
3726
3726
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3727
3727
|
if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
|
|
3728
3728
|
const len = data.length, three = len === 9;
|
|
@@ -3731,6 +3731,11 @@ const PathCorner = {
|
|
|
3731
3731
|
command = data[i];
|
|
3732
3732
|
switch (command) {
|
|
3733
3733
|
case M:
|
|
3734
|
+
smoothLen = smooth.length;
|
|
3735
|
+
if (smoothLen && lastCommand !== Z) {
|
|
3736
|
+
smooth[startXIndex] = startX;
|
|
3737
|
+
smooth[startYIndex] = startY;
|
|
3738
|
+
}
|
|
3734
3739
|
startX = lastX = data[i + 1];
|
|
3735
3740
|
startY = lastY = data[i + 2];
|
|
3736
3741
|
i += 3;
|
|
@@ -3741,6 +3746,8 @@ const PathCorner = {
|
|
|
3741
3746
|
} else {
|
|
3742
3747
|
smooth.push(M, startX, startY);
|
|
3743
3748
|
}
|
|
3749
|
+
startXIndex = smoothLen + 1;
|
|
3750
|
+
startYIndex = smoothLen + 2;
|
|
3744
3751
|
break;
|
|
3745
3752
|
|
|
3746
3753
|
case L$1:
|
|
@@ -3779,8 +3786,8 @@ const PathCorner = {
|
|
|
3779
3786
|
lastCommand = command;
|
|
3780
3787
|
}
|
|
3781
3788
|
if (command !== Z) {
|
|
3782
|
-
smooth[
|
|
3783
|
-
smooth[
|
|
3789
|
+
smooth[startXIndex] = startX;
|
|
3790
|
+
smooth[startYIndex] = startY;
|
|
3784
3791
|
}
|
|
3785
3792
|
return smooth;
|
|
3786
3793
|
}
|
|
@@ -6976,7 +6983,7 @@ class LeafLevelList {
|
|
|
6976
6983
|
}
|
|
6977
6984
|
}
|
|
6978
6985
|
|
|
6979
|
-
const version = "2.1.
|
|
6986
|
+
const version = "2.1.6";
|
|
6980
6987
|
|
|
6981
6988
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6982
6989
|
get allowBackgroundColor() {
|
|
@@ -12082,8 +12089,9 @@ function getPatternData(paint, box, image) {
|
|
|
12082
12089
|
break;
|
|
12083
12090
|
|
|
12084
12091
|
case "repeat":
|
|
12085
|
-
case "brush":
|
|
12086
12092
|
if (!sameBox || scaleX || rotation || skew) PaintImage.repeatMode(data, box, width, height, tempImage.x, tempImage.y, scaleX, scaleY, rotation, skew, align, paint.freeTransform);
|
|
12093
|
+
|
|
12094
|
+
case "brush":
|
|
12087
12095
|
if (!repeat) data.repeat = "repeat";
|
|
12088
12096
|
const count = isObject(repeat);
|
|
12089
12097
|
if (gap || count) data.gap = getGapData(gap, count && repeat, tempImage.width, tempImage.height, box);
|
|
@@ -12094,7 +12102,7 @@ function getPatternData(paint, box, image) {
|
|
|
12094
12102
|
default:
|
|
12095
12103
|
if (scaleX) PaintImage.fillOrFitMode(data, box, tempImage.x, tempImage.y, scaleX, scaleY, rotation);
|
|
12096
12104
|
}
|
|
12097
|
-
if (!data.transform) {
|
|
12105
|
+
if (!data.transform && mode !== "brush") {
|
|
12098
12106
|
if (box.x || box.y) translate$1(data.transform = get$3(), box.x, box.y);
|
|
12099
12107
|
}
|
|
12100
12108
|
if (scaleX) {
|
|
@@ -12223,8 +12231,9 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
12223
12231
|
let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
|
|
12224
12232
|
if (paint.patternId !== id && !ui.destroyed) {
|
|
12225
12233
|
if (!(Platform.image.isLarge(paint.image, scaleX, scaleY) && !paint.data.repeat)) {
|
|
12226
|
-
const {image: image, brush: brush, data: data} = paint, {
|
|
12227
|
-
let imageMatrix, xGap, yGap, {width: width, height: height} = image;
|
|
12234
|
+
const {image: image, brush: brush, data: data} = paint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
|
|
12235
|
+
let imageMatrix, xGap, yGap, {width: width, height: height} = image, {opacity: opacity} = paint.originPaint;
|
|
12236
|
+
if (brush || opacity === 1) opacity = undefined;
|
|
12228
12237
|
if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
|
|
12229
12238
|
width *= scaleX;
|
|
12230
12239
|
height *= scaleY;
|