leafer-ui 1.12.0 → 1.12.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/README.md +4 -13
- package/dist/web.cjs +25 -28
- package/dist/web.esm.js +26 -29
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +172 -111
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +176 -111
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/web.js
CHANGED
|
@@ -425,8 +425,8 @@ var LeaferUI = function(exports) {
|
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
427
|
const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
|
|
428
|
-
const {float: float$
|
|
429
|
-
const tempPoint$
|
|
428
|
+
const {float: float$3} = MathHelper;
|
|
429
|
+
const tempPoint$4 = {};
|
|
430
430
|
function getWorld() {
|
|
431
431
|
return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
|
|
432
432
|
scaleX: 1,
|
|
@@ -483,8 +483,8 @@ var LeaferUI = function(exports) {
|
|
|
483
483
|
to.f = t.f * pixelRatio;
|
|
484
484
|
},
|
|
485
485
|
scaleOfOuter(t, origin, scaleX, scaleY) {
|
|
486
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
487
|
-
M$6.scaleOfInner(t, tempPoint$
|
|
486
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
487
|
+
M$6.scaleOfInner(t, tempPoint$4, scaleX, scaleY);
|
|
488
488
|
},
|
|
489
489
|
scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
|
|
490
490
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -502,8 +502,8 @@ var LeaferUI = function(exports) {
|
|
|
502
502
|
t.d = c * sinR + d * cosR;
|
|
503
503
|
},
|
|
504
504
|
rotateOfOuter(t, origin, rotation) {
|
|
505
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
506
|
-
M$6.rotateOfInner(t, tempPoint$
|
|
505
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
506
|
+
M$6.rotateOfInner(t, tempPoint$4, rotation);
|
|
507
507
|
},
|
|
508
508
|
rotateOfInner(t, origin, rotation) {
|
|
509
509
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -524,8 +524,8 @@ var LeaferUI = function(exports) {
|
|
|
524
524
|
}
|
|
525
525
|
},
|
|
526
526
|
skewOfOuter(t, origin, skewX, skewY) {
|
|
527
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
528
|
-
M$6.skewOfInner(t, tempPoint$
|
|
527
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
528
|
+
M$6.skewOfInner(t, tempPoint$4, skewX, skewY);
|
|
529
529
|
},
|
|
530
530
|
skewOfInner(t, origin, skewX, skewY = 0) {
|
|
531
531
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -673,12 +673,12 @@ var LeaferUI = function(exports) {
|
|
|
673
673
|
const cosR = c / scaleY;
|
|
674
674
|
rotation = PI_2 - (d > 0 ? acos(-cosR) : -acos(cosR));
|
|
675
675
|
}
|
|
676
|
-
const cosR = float$
|
|
676
|
+
const cosR = float$3(cos$5(rotation));
|
|
677
677
|
const sinR = sin$5(rotation);
|
|
678
|
-
scaleX = float$
|
|
679
|
-
skewX = cosR ? float$
|
|
680
|
-
skewY = cosR ? float$
|
|
681
|
-
rotation = float$
|
|
678
|
+
scaleX = float$3(scaleX), scaleY = float$3(scaleY);
|
|
679
|
+
skewX = cosR ? float$3((c / scaleY + sinR) / cosR / OneRadian, 9) : 0;
|
|
680
|
+
skewY = cosR ? float$3((b / scaleX - sinR) / cosR / OneRadian, 9) : 0;
|
|
681
|
+
rotation = float$3(rotation / OneRadian);
|
|
682
682
|
} else {
|
|
683
683
|
scaleX = a;
|
|
684
684
|
scaleY = d;
|
|
@@ -720,6 +720,7 @@ var LeaferUI = function(exports) {
|
|
|
720
720
|
}
|
|
721
721
|
};
|
|
722
722
|
const M$6 = MatrixHelper;
|
|
723
|
+
const {float: float$2} = MathHelper;
|
|
723
724
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
724
725
|
const {sin: sin$4, cos: cos$4, abs: abs$5, sqrt: sqrt$2, atan2: atan2$2, min: min$2, round: round$2} = Math;
|
|
725
726
|
const PointHelper = {
|
|
@@ -769,22 +770,27 @@ var LeaferUI = function(exports) {
|
|
|
769
770
|
},
|
|
770
771
|
tempToInnerOf(t, matrix) {
|
|
771
772
|
const {tempPoint: temp} = P$5;
|
|
772
|
-
copy$
|
|
773
|
+
copy$9(temp, t);
|
|
773
774
|
toInnerPoint$2(matrix, temp, temp);
|
|
774
775
|
return temp;
|
|
775
776
|
},
|
|
776
777
|
tempToOuterOf(t, matrix) {
|
|
777
778
|
const {tempPoint: temp} = P$5;
|
|
778
|
-
copy$
|
|
779
|
+
copy$9(temp, t);
|
|
779
780
|
toOuterPoint$3(matrix, temp, temp);
|
|
780
781
|
return temp;
|
|
781
782
|
},
|
|
782
783
|
tempToInnerRadiusPointOf(t, matrix) {
|
|
783
784
|
const {tempRadiusPoint: temp} = P$5;
|
|
784
|
-
copy$
|
|
785
|
+
copy$9(temp, t);
|
|
785
786
|
P$5.toInnerRadiusPointOf(t, matrix, temp);
|
|
786
787
|
return temp;
|
|
787
788
|
},
|
|
789
|
+
copyRadiusPoint(t, point, x, y) {
|
|
790
|
+
copy$9(t, point);
|
|
791
|
+
setRadius(t, x, y);
|
|
792
|
+
return t;
|
|
793
|
+
},
|
|
788
794
|
toInnerRadiusPointOf(t, matrix, to) {
|
|
789
795
|
to || (to = t);
|
|
790
796
|
toInnerPoint$2(matrix, t, to);
|
|
@@ -852,14 +858,14 @@ var LeaferUI = function(exports) {
|
|
|
852
858
|
return points;
|
|
853
859
|
},
|
|
854
860
|
isSame(t, point) {
|
|
855
|
-
return t.x === point.x && t.y === point.y;
|
|
861
|
+
return float$2(t.x) === float$2(point.x) && float$2(t.y) === float$2(point.y);
|
|
856
862
|
},
|
|
857
863
|
reset(t) {
|
|
858
864
|
P$5.reset(t);
|
|
859
865
|
}
|
|
860
866
|
};
|
|
861
867
|
const P$5 = PointHelper;
|
|
862
|
-
const {getDistanceFrom: getDistanceFrom, copy: copy$
|
|
868
|
+
const {getDistanceFrom: getDistanceFrom, copy: copy$9, setRadius: setRadius, getAtan2: getAtan2} = P$5;
|
|
863
869
|
class Point {
|
|
864
870
|
constructor(x, y) {
|
|
865
871
|
this.set(x, y);
|
|
@@ -932,7 +938,7 @@ var LeaferUI = function(exports) {
|
|
|
932
938
|
return this;
|
|
933
939
|
}
|
|
934
940
|
}
|
|
935
|
-
const tempPoint$
|
|
941
|
+
const tempPoint$3 = new Point;
|
|
936
942
|
class Matrix {
|
|
937
943
|
constructor(a, b, c, d, e, f) {
|
|
938
944
|
this.set(a, b, c, d, e, f);
|
|
@@ -1245,7 +1251,7 @@ var LeaferUI = function(exports) {
|
|
|
1245
1251
|
return t;
|
|
1246
1252
|
},
|
|
1247
1253
|
toOffsetOutBounds(t, to, offsetBounds) {
|
|
1248
|
-
if (!to) to = t; else copy$
|
|
1254
|
+
if (!to) to = t; else copy$8(to, t);
|
|
1249
1255
|
if (!offsetBounds) offsetBounds = t;
|
|
1250
1256
|
to.offsetX = B.maxX(offsetBounds);
|
|
1251
1257
|
to.offsetY = B.maxY(offsetBounds);
|
|
@@ -1392,7 +1398,7 @@ var LeaferUI = function(exports) {
|
|
|
1392
1398
|
if (bounds && (bounds.width || bounds.height)) {
|
|
1393
1399
|
if (first) {
|
|
1394
1400
|
first = false;
|
|
1395
|
-
if (!addMode) copy$
|
|
1401
|
+
if (!addMode) copy$8(t, bounds);
|
|
1396
1402
|
} else {
|
|
1397
1403
|
add$2(t, bounds);
|
|
1398
1404
|
}
|
|
@@ -1477,7 +1483,7 @@ var LeaferUI = function(exports) {
|
|
|
1477
1483
|
}
|
|
1478
1484
|
};
|
|
1479
1485
|
const B = BoundsHelper;
|
|
1480
|
-
const {add: add$2, copy: copy$
|
|
1486
|
+
const {add: add$2, copy: copy$8} = B;
|
|
1481
1487
|
class Bounds {
|
|
1482
1488
|
get minX() {
|
|
1483
1489
|
return BoundsHelper.minX(this);
|
|
@@ -2084,7 +2090,7 @@ var LeaferUI = function(exports) {
|
|
|
2084
2090
|
__decorate([ contextMethod() ], Canvas.prototype, "fillText", null);
|
|
2085
2091
|
__decorate([ contextMethod() ], Canvas.prototype, "measureText", null);
|
|
2086
2092
|
__decorate([ contextMethod() ], Canvas.prototype, "strokeText", null);
|
|
2087
|
-
const {copy: copy$
|
|
2093
|
+
const {copy: copy$7, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$1} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
|
|
2088
2094
|
const minSize = {
|
|
2089
2095
|
width: 1,
|
|
2090
2096
|
height: 1,
|
|
@@ -2241,7 +2247,7 @@ var LeaferUI = function(exports) {
|
|
|
2241
2247
|
const {pixelRatio: pixelRatio} = this;
|
|
2242
2248
|
this.filter = `blur(${blur * pixelRatio}px)`;
|
|
2243
2249
|
}
|
|
2244
|
-
copyWorld(canvas, from, to, blendMode, ceilPixel
|
|
2250
|
+
copyWorld(canvas, from, to, blendMode, ceilPixel) {
|
|
2245
2251
|
if (blendMode) this.blendMode = blendMode;
|
|
2246
2252
|
if (from) {
|
|
2247
2253
|
this.setTempPixelBounds(from, ceilPixel);
|
|
@@ -2252,7 +2258,7 @@ var LeaferUI = function(exports) {
|
|
|
2252
2258
|
}
|
|
2253
2259
|
if (blendMode) this.blendMode = "source-over";
|
|
2254
2260
|
}
|
|
2255
|
-
copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode, ceilPixel
|
|
2261
|
+
copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode, ceilPixel) {
|
|
2256
2262
|
if (fromWorld.b || fromWorld.c) {
|
|
2257
2263
|
this.save();
|
|
2258
2264
|
this.resetTransform();
|
|
@@ -2265,7 +2271,7 @@ var LeaferUI = function(exports) {
|
|
|
2265
2271
|
if (blendMode) this.blendMode = "source-over";
|
|
2266
2272
|
}
|
|
2267
2273
|
}
|
|
2268
|
-
copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform, ceilPixel
|
|
2274
|
+
copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform, ceilPixel) {
|
|
2269
2275
|
this.resetTransform();
|
|
2270
2276
|
this.copyWorld(canvas, from, to, blendMode, ceilPixel);
|
|
2271
2277
|
if (!onlyResetTransform) this.useWorldTransform();
|
|
@@ -2335,7 +2341,7 @@ var LeaferUI = function(exports) {
|
|
|
2335
2341
|
getSameCanvas(useSameWorldTransform, useSameSmooth) {
|
|
2336
2342
|
const {size: size, pixelSnap: pixelSnap} = this, canvas = this.manager ? this.manager.get(size) : Creator.canvas(Object.assign({}, size));
|
|
2337
2343
|
canvas.save();
|
|
2338
|
-
if (useSameWorldTransform) copy$
|
|
2344
|
+
if (useSameWorldTransform) copy$7(canvas.worldTransform, this.worldTransform), canvas.useWorldTransform();
|
|
2339
2345
|
if (useSameSmooth) canvas.smooth = this.smooth;
|
|
2340
2346
|
canvas.pixelSnap !== pixelSnap && (canvas.pixelSnap = pixelSnap);
|
|
2341
2347
|
return canvas;
|
|
@@ -2467,14 +2473,14 @@ var LeaferUI = function(exports) {
|
|
|
2467
2473
|
const {setPoint: setPoint$1, addPoint: addPoint$1} = TwoPointBoundsHelper;
|
|
2468
2474
|
const {set: set$1, toNumberPoints: toNumberPoints} = PointHelper;
|
|
2469
2475
|
const {M: M$5, L: L$6, C: C$4, Q: Q$4, Z: Z$5} = PathCommandMap;
|
|
2470
|
-
const tempPoint$
|
|
2476
|
+
const tempPoint$2 = {};
|
|
2471
2477
|
const BezierHelper = {
|
|
2472
2478
|
points(data, originPoints, curve, close) {
|
|
2473
2479
|
let points = toNumberPoints(originPoints);
|
|
2474
2480
|
data.push(M$5, points[0], points[1]);
|
|
2475
2481
|
if (curve && points.length > 5) {
|
|
2476
2482
|
let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
|
|
2477
|
-
let ba, cb, d, len = points.length;
|
|
2483
|
+
let baX, baY, ba, cb, d, len = points.length;
|
|
2478
2484
|
const t = curve === true ? .5 : curve;
|
|
2479
2485
|
if (close) {
|
|
2480
2486
|
points = [ points[len - 2], points[len - 1], ...points, points[0], points[1], points[2], points[3] ];
|
|
@@ -2487,7 +2493,9 @@ var LeaferUI = function(exports) {
|
|
|
2487
2493
|
bY = points[i + 1];
|
|
2488
2494
|
cX = points[i + 2];
|
|
2489
2495
|
cY = points[i + 3];
|
|
2490
|
-
|
|
2496
|
+
baX = bX - aX;
|
|
2497
|
+
baY = bY - aY;
|
|
2498
|
+
ba = sqrt$1(pow(baX, 2) + pow(baY, 2));
|
|
2491
2499
|
cb = sqrt$1(pow(cX - bX, 2) + pow(cY - bY, 2));
|
|
2492
2500
|
if (!ba && !cb) continue;
|
|
2493
2501
|
d = ba + cb;
|
|
@@ -2500,7 +2508,7 @@ var LeaferUI = function(exports) {
|
|
|
2500
2508
|
if (i === 2) {
|
|
2501
2509
|
if (!close) data.push(Q$4, c1X, c1Y, bX, bY);
|
|
2502
2510
|
} else {
|
|
2503
|
-
data.push(C$4, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2511
|
+
if (baX || baY) data.push(C$4, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2504
2512
|
}
|
|
2505
2513
|
c2X = bX + cb * cX;
|
|
2506
2514
|
c2Y = bY + cb * cY;
|
|
@@ -2635,8 +2643,8 @@ var LeaferUI = function(exports) {
|
|
|
2635
2643
|
addMode ? addPoint$1(pointBounds, fromX, fromY) : setPoint$1(pointBounds, fromX, fromY);
|
|
2636
2644
|
addPoint$1(pointBounds, toX, toY);
|
|
2637
2645
|
for (let i = 0, len = tList.length; i < len; i++) {
|
|
2638
|
-
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$
|
|
2639
|
-
addPoint$1(pointBounds, tempPoint$
|
|
2646
|
+
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$2);
|
|
2647
|
+
addPoint$1(pointBounds, tempPoint$2.x, tempPoint$2.y);
|
|
2640
2648
|
}
|
|
2641
2649
|
},
|
|
2642
2650
|
getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
|
|
@@ -3068,6 +3076,7 @@ var LeaferUI = function(exports) {
|
|
|
3068
3076
|
}
|
|
3069
3077
|
},
|
|
3070
3078
|
ellipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
3079
|
+
if (radiusX === radiusY) return arc$2(data, x, y, radiusX, startAngle, endAngle, anticlockwise);
|
|
3071
3080
|
if (isNull(rotation)) {
|
|
3072
3081
|
data.push(F$3, x, y, radiusX, radiusY);
|
|
3073
3082
|
} else {
|
|
@@ -3080,6 +3089,7 @@ var LeaferUI = function(exports) {
|
|
|
3080
3089
|
if (isNull(startAngle)) {
|
|
3081
3090
|
data.push(P$2, x, y, radius);
|
|
3082
3091
|
} else {
|
|
3092
|
+
if (isNull(startAngle)) startAngle = 0;
|
|
3083
3093
|
if (isNull(endAngle)) endAngle = 360;
|
|
3084
3094
|
data.push(O$2, x, y, radius, startAngle, endAngle, anticlockwise ? 1 : 0);
|
|
3085
3095
|
}
|
|
@@ -3280,7 +3290,7 @@ var LeaferUI = function(exports) {
|
|
|
3280
3290
|
};
|
|
3281
3291
|
const {M: M$1, L: L$2, C: C, Q: Q, Z: Z$1, N: N, D: D$1, X: X, G: G, F: F$1, O: O, P: P, U: U} = PathCommandMap;
|
|
3282
3292
|
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$1} = BezierHelper;
|
|
3283
|
-
const {addPointBounds: addPointBounds, copy: copy$
|
|
3293
|
+
const {addPointBounds: addPointBounds, copy: copy$6, addPoint: addPoint, setPoint: setPoint, addBounds: addBounds, toBounds: toBounds$1} = TwoPointBoundsHelper;
|
|
3284
3294
|
const debug$b = Debug.get("PathBounds");
|
|
3285
3295
|
let radius, radiusX, radiusY;
|
|
3286
3296
|
const tempPointBounds = {};
|
|
@@ -3356,7 +3366,7 @@ var LeaferUI = function(exports) {
|
|
|
3356
3366
|
|
|
3357
3367
|
case G:
|
|
3358
3368
|
ellipse$1(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
|
|
3359
|
-
i === 0 ? copy$
|
|
3369
|
+
i === 0 ? copy$6(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3360
3370
|
x = setEndPoint.x;
|
|
3361
3371
|
y = setEndPoint.y;
|
|
3362
3372
|
i += 9;
|
|
@@ -3374,7 +3384,7 @@ var LeaferUI = function(exports) {
|
|
|
3374
3384
|
|
|
3375
3385
|
case O:
|
|
3376
3386
|
arc(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], tempPointBounds, setEndPoint);
|
|
3377
|
-
i === 0 ? copy$
|
|
3387
|
+
i === 0 ? copy$6(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3378
3388
|
x = setEndPoint.x;
|
|
3379
3389
|
y = setEndPoint.y;
|
|
3380
3390
|
i += 7;
|
|
@@ -3391,7 +3401,7 @@ var LeaferUI = function(exports) {
|
|
|
3391
3401
|
|
|
3392
3402
|
case U:
|
|
3393
3403
|
arcTo$1(null, x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], tempPointBounds, setEndPoint);
|
|
3394
|
-
i === 0 ? copy$
|
|
3404
|
+
i === 0 ? copy$6(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3395
3405
|
x = setEndPoint.x;
|
|
3396
3406
|
y = setEndPoint.y;
|
|
3397
3407
|
i += 6;
|
|
@@ -3411,6 +3421,7 @@ var LeaferUI = function(exports) {
|
|
|
3411
3421
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3412
3422
|
let command, lastCommand, commandLen;
|
|
3413
3423
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3424
|
+
if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
|
|
3414
3425
|
const len = data.length;
|
|
3415
3426
|
const smooth = [];
|
|
3416
3427
|
while (i < len) {
|
|
@@ -3808,7 +3819,9 @@ var LeaferUI = function(exports) {
|
|
|
3808
3819
|
const ImageManager = {
|
|
3809
3820
|
maxRecycled: 10,
|
|
3810
3821
|
recycledList: [],
|
|
3811
|
-
patternTasker: new TaskProcessor
|
|
3822
|
+
patternTasker: new TaskProcessor({
|
|
3823
|
+
parallel: 1
|
|
3824
|
+
}),
|
|
3812
3825
|
get(config) {
|
|
3813
3826
|
let image = Resource.get(config.url);
|
|
3814
3827
|
if (!image) Resource.set(config.url, image = Creator.image(config));
|
|
@@ -4338,7 +4351,7 @@ var LeaferUI = function(exports) {
|
|
|
4338
4351
|
EventCreator.register(target);
|
|
4339
4352
|
};
|
|
4340
4353
|
}
|
|
4341
|
-
const {copy: copy$
|
|
4354
|
+
const {copy: copy$5, toInnerPoint: toInnerPoint$1, toOuterPoint: toOuterPoint$1, scaleOfOuter: scaleOfOuter$2, rotateOfOuter: rotateOfOuter$2, skewOfOuter: skewOfOuter, multiplyParent: multiplyParent$3, divideParent: divideParent, getLayout: getLayout} = MatrixHelper;
|
|
4342
4355
|
const matrix$1 = {}, {round: round} = Math;
|
|
4343
4356
|
const LeafHelper = {
|
|
4344
4357
|
updateAllMatrix(leaf, checkAutoLayout, waitAutoLayout) {
|
|
@@ -4434,7 +4447,7 @@ var LeaferUI = function(exports) {
|
|
|
4434
4447
|
if (scaleY) transition = scaleY;
|
|
4435
4448
|
scaleY = scaleX;
|
|
4436
4449
|
}
|
|
4437
|
-
copy$
|
|
4450
|
+
copy$5(matrix$1, o);
|
|
4438
4451
|
scaleOfOuter$2(matrix$1, origin, scaleX, scaleY);
|
|
4439
4452
|
if (L.hasHighPosition(t)) {
|
|
4440
4453
|
L.setTransform(t, matrix$1, resize, transition);
|
|
@@ -4453,7 +4466,7 @@ var LeaferUI = function(exports) {
|
|
|
4453
4466
|
},
|
|
4454
4467
|
rotateOfLocal(t, origin, angle, transition) {
|
|
4455
4468
|
const o = t.__localMatrix;
|
|
4456
|
-
copy$
|
|
4469
|
+
copy$5(matrix$1, o);
|
|
4457
4470
|
rotateOfOuter$2(matrix$1, origin, angle);
|
|
4458
4471
|
if (L.hasHighPosition(t)) L.setTransform(t, matrix$1, false, transition); else t.set({
|
|
4459
4472
|
x: t.x + matrix$1.e - o.e,
|
|
@@ -4465,18 +4478,18 @@ var LeaferUI = function(exports) {
|
|
|
4465
4478
|
L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
|
|
4466
4479
|
},
|
|
4467
4480
|
skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
|
|
4468
|
-
copy$
|
|
4481
|
+
copy$5(matrix$1, t.__localMatrix);
|
|
4469
4482
|
skewOfOuter(matrix$1, origin, skewX, skewY);
|
|
4470
4483
|
L.setTransform(t, matrix$1, resize, transition);
|
|
4471
4484
|
},
|
|
4472
4485
|
transformWorld(t, transform, resize, transition) {
|
|
4473
|
-
copy$
|
|
4486
|
+
copy$5(matrix$1, t.worldTransform);
|
|
4474
4487
|
multiplyParent$3(matrix$1, transform);
|
|
4475
4488
|
if (t.parent) divideParent(matrix$1, t.parent.scrollWorldTransform);
|
|
4476
4489
|
L.setTransform(t, matrix$1, resize, transition);
|
|
4477
4490
|
},
|
|
4478
4491
|
transform(t, transform, resize, transition) {
|
|
4479
|
-
copy$
|
|
4492
|
+
copy$5(matrix$1, t.localTransform);
|
|
4480
4493
|
multiplyParent$3(matrix$1, transform);
|
|
4481
4494
|
L.setTransform(t, matrix$1, resize, transition);
|
|
4482
4495
|
},
|
|
@@ -4514,7 +4527,7 @@ var LeaferUI = function(exports) {
|
|
|
4514
4527
|
return innerOrigin;
|
|
4515
4528
|
},
|
|
4516
4529
|
getRelativeWorld(t, relative, temp) {
|
|
4517
|
-
copy$
|
|
4530
|
+
copy$5(matrix$1, t.worldTransform);
|
|
4518
4531
|
divideParent(matrix$1, relative.scrollWorldTransform);
|
|
4519
4532
|
return temp ? matrix$1 : Object.assign({}, matrix$1);
|
|
4520
4533
|
},
|
|
@@ -4652,9 +4665,52 @@ var LeaferUI = function(exports) {
|
|
|
4652
4665
|
if (exclude && exclude === branch) continue;
|
|
4653
4666
|
updateBounds$3(branch);
|
|
4654
4667
|
}
|
|
4668
|
+
},
|
|
4669
|
+
move(branch, x, y) {
|
|
4670
|
+
let w;
|
|
4671
|
+
const {children: children} = branch;
|
|
4672
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
4673
|
+
branch = children[i];
|
|
4674
|
+
w = branch.__world;
|
|
4675
|
+
w.e += x;
|
|
4676
|
+
w.f += y;
|
|
4677
|
+
w.x += x;
|
|
4678
|
+
w.y += y;
|
|
4679
|
+
if (branch.isBranch) move$3(branch, x, y);
|
|
4680
|
+
}
|
|
4681
|
+
},
|
|
4682
|
+
scale(branch, x, y, scaleX, scaleY, a, b) {
|
|
4683
|
+
let w;
|
|
4684
|
+
const {children: children} = branch;
|
|
4685
|
+
const changeScaleX = scaleX - 1;
|
|
4686
|
+
const changeScaleY = scaleY - 1;
|
|
4687
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
4688
|
+
branch = children[i];
|
|
4689
|
+
w = branch.__world;
|
|
4690
|
+
w.a *= scaleX;
|
|
4691
|
+
w.d *= scaleY;
|
|
4692
|
+
if (w.b || w.c) {
|
|
4693
|
+
w.b *= scaleX;
|
|
4694
|
+
w.c *= scaleY;
|
|
4695
|
+
}
|
|
4696
|
+
if (w.e === w.x && w.f === w.y) {
|
|
4697
|
+
w.x = w.e += (w.e - a) * changeScaleX + x;
|
|
4698
|
+
w.y = w.f += (w.f - b) * changeScaleY + y;
|
|
4699
|
+
} else {
|
|
4700
|
+
w.e += (w.e - a) * changeScaleX + x;
|
|
4701
|
+
w.f += (w.f - b) * changeScaleY + y;
|
|
4702
|
+
w.x += (w.x - a) * changeScaleX + x;
|
|
4703
|
+
w.y += (w.y - b) * changeScaleY + y;
|
|
4704
|
+
}
|
|
4705
|
+
w.width *= scaleX;
|
|
4706
|
+
w.height *= scaleY;
|
|
4707
|
+
w.scaleX *= scaleX;
|
|
4708
|
+
w.scaleY *= scaleY;
|
|
4709
|
+
if (branch.isBranch) scale$1(branch, x, y, scaleX, scaleY, a, b);
|
|
4710
|
+
}
|
|
4655
4711
|
}
|
|
4656
4712
|
};
|
|
4657
|
-
const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack} = BranchHelper;
|
|
4713
|
+
const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$3, scale: scale$1} = BranchHelper;
|
|
4658
4714
|
const WaitHelper = {
|
|
4659
4715
|
run(wait) {
|
|
4660
4716
|
if (wait && wait.length) {
|
|
@@ -4667,7 +4723,7 @@ var LeaferUI = function(exports) {
|
|
|
4667
4723
|
}
|
|
4668
4724
|
};
|
|
4669
4725
|
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$2} = LeafHelper;
|
|
4670
|
-
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$
|
|
4726
|
+
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$4} = BoundsHelper;
|
|
4671
4727
|
const localContent = "_localContentBounds";
|
|
4672
4728
|
const worldContent = "_worldContentBounds", worldBox = "_worldBoxBounds", worldStroke = "_worldStrokeBounds";
|
|
4673
4729
|
class LeafLayout {
|
|
@@ -4903,7 +4959,7 @@ var LeaferUI = function(exports) {
|
|
|
4903
4959
|
matrix = getRelativeWorld$1(leaf, relative, true);
|
|
4904
4960
|
}
|
|
4905
4961
|
if (!layoutBounds) layoutBounds = MatrixHelper.getLayout(matrix);
|
|
4906
|
-
copy$
|
|
4962
|
+
copy$4(layoutBounds, bounds);
|
|
4907
4963
|
PointHelper.copy(layoutBounds, point);
|
|
4908
4964
|
if (unscale) {
|
|
4909
4965
|
const {scaleX: scaleX, scaleY: scaleY} = layoutBounds;
|
|
@@ -5448,7 +5504,7 @@ var LeaferUI = function(exports) {
|
|
|
5448
5504
|
}
|
|
5449
5505
|
};
|
|
5450
5506
|
const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
|
|
5451
|
-
const {toPoint: toPoint$3, tempPoint: tempPoint} = AroundHelper;
|
|
5507
|
+
const {toPoint: toPoint$3, tempPoint: tempPoint$1} = AroundHelper;
|
|
5452
5508
|
const LeafMatrix = {
|
|
5453
5509
|
__updateWorldMatrix() {
|
|
5454
5510
|
const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
|
|
@@ -5467,8 +5523,8 @@ var LeaferUI = function(exports) {
|
|
|
5467
5523
|
local.e = data.x + data.offsetX;
|
|
5468
5524
|
local.f = data.y + data.offsetY;
|
|
5469
5525
|
if (data.around || data.origin) {
|
|
5470
|
-
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint);
|
|
5471
|
-
translateInner(local, -tempPoint.x, -tempPoint.y, !data.around);
|
|
5526
|
+
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$1);
|
|
5527
|
+
translateInner(local, -tempPoint$1.x, -tempPoint$1.y, !data.around);
|
|
5472
5528
|
}
|
|
5473
5529
|
}
|
|
5474
5530
|
this.__layout.matrixChanged = undefined;
|
|
@@ -5476,7 +5532,7 @@ var LeaferUI = function(exports) {
|
|
|
5476
5532
|
};
|
|
5477
5533
|
const {updateMatrix: updateMatrix$1, updateAllMatrix: updateAllMatrix$2} = LeafHelper;
|
|
5478
5534
|
const {updateBounds: updateBounds$1} = BranchHelper;
|
|
5479
|
-
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$
|
|
5535
|
+
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$3} = BoundsHelper;
|
|
5480
5536
|
const {toBounds: toBounds} = PathBounds;
|
|
5481
5537
|
const LeafBounds = {
|
|
5482
5538
|
__updateWorldBounds() {
|
|
@@ -5585,7 +5641,7 @@ var LeaferUI = function(exports) {
|
|
|
5585
5641
|
},
|
|
5586
5642
|
__updateRenderBounds(_bounds) {
|
|
5587
5643
|
const layout = this.__layout, {renderSpread: renderSpread} = layout;
|
|
5588
|
-
isNumber(renderSpread) && renderSpread <= 0 ? copy$
|
|
5644
|
+
isNumber(renderSpread) && renderSpread <= 0 ? copy$3(layout.renderBounds, layout.strokeBounds) : copyAndSpread$2(layout.renderBounds, layout.boxBounds, renderSpread);
|
|
5589
5645
|
}
|
|
5590
5646
|
};
|
|
5591
5647
|
const LeafRender = {
|
|
@@ -5681,7 +5737,7 @@ var LeaferUI = function(exports) {
|
|
|
5681
5737
|
const {stintSet: stintSet$4} = DataHelper;
|
|
5682
5738
|
const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint, multiplyParent: multiplyParent$1} = MatrixHelper;
|
|
5683
5739
|
const {toOuterOf: toOuterOf$1} = BoundsHelper;
|
|
5684
|
-
const {copy: copy$
|
|
5740
|
+
const {copy: copy$2, move: move$2} = PointHelper;
|
|
5685
5741
|
const {moveLocal: moveLocal, zoomOfLocal: zoomOfLocal, rotateOfLocal: rotateOfLocal, skewOfLocal: skewOfLocal, moveWorld: moveWorld, zoomOfWorld: zoomOfWorld, rotateOfWorld: rotateOfWorld, skewOfWorld: skewOfWorld, transform: transform, transformWorld: transformWorld, setTransform: setTransform, getFlipTransform: getFlipTransform, getLocalOrigin: getLocalOrigin, getRelativeWorld: getRelativeWorld, drop: drop} = LeafHelper;
|
|
5686
5742
|
exports.Leaf = class Leaf {
|
|
5687
5743
|
get tag() {
|
|
@@ -5998,14 +6054,14 @@ var LeaferUI = function(exports) {
|
|
|
5998
6054
|
if (this.parent) {
|
|
5999
6055
|
this.parent.worldToInner(world, to, distance, relative);
|
|
6000
6056
|
} else {
|
|
6001
|
-
if (to) copy$
|
|
6057
|
+
if (to) copy$2(to, world);
|
|
6002
6058
|
}
|
|
6003
6059
|
}
|
|
6004
6060
|
localToWorld(local, to, distance, relative) {
|
|
6005
6061
|
if (this.parent) {
|
|
6006
6062
|
this.parent.innerToWorld(local, to, distance, relative);
|
|
6007
6063
|
} else {
|
|
6008
|
-
if (to) copy$
|
|
6064
|
+
if (to) copy$2(to, local);
|
|
6009
6065
|
}
|
|
6010
6066
|
}
|
|
6011
6067
|
worldToInner(world, to, distance, relative) {
|
|
@@ -6118,10 +6174,10 @@ var LeaferUI = function(exports) {
|
|
|
6118
6174
|
hit(_world, _hitRadius) {
|
|
6119
6175
|
return true;
|
|
6120
6176
|
}
|
|
6121
|
-
__hitWorld(_point) {
|
|
6177
|
+
__hitWorld(_point, _forceHitFill) {
|
|
6122
6178
|
return true;
|
|
6123
6179
|
}
|
|
6124
|
-
__hit(_local) {
|
|
6180
|
+
__hit(_local, _forceHitFill) {
|
|
6125
6181
|
return true;
|
|
6126
6182
|
}
|
|
6127
6183
|
__hitFill(_inner) {
|
|
@@ -6470,7 +6526,7 @@ var LeaferUI = function(exports) {
|
|
|
6470
6526
|
this.levelMap = null;
|
|
6471
6527
|
}
|
|
6472
6528
|
}
|
|
6473
|
-
const version = "1.12.
|
|
6529
|
+
const version = "1.12.2";
|
|
6474
6530
|
const debug$5 = Debug.get("LeaferCanvas");
|
|
6475
6531
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6476
6532
|
set zIndex(zIndex) {
|
|
@@ -6500,6 +6556,7 @@ var LeaferUI = function(exports) {
|
|
|
6500
6556
|
if (this.parentView) {
|
|
6501
6557
|
const pStyle = this.parentView.style;
|
|
6502
6558
|
pStyle.webkitUserSelect = pStyle.userSelect = "none";
|
|
6559
|
+
this.view.classList.add("leafer-canvas-view");
|
|
6503
6560
|
}
|
|
6504
6561
|
if (Platform.syncDomFont && !this.parentView) {
|
|
6505
6562
|
style.display = "none";
|
|
@@ -6559,19 +6616,9 @@ var LeaferUI = function(exports) {
|
|
|
6559
6616
|
updateViewSize() {
|
|
6560
6617
|
const {width: width, height: height, pixelRatio: pixelRatio} = this;
|
|
6561
6618
|
const {style: style} = this.view;
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
if (isUndefined(autoWidthStr)) this.autoWidthStr = style.width || "";
|
|
6566
|
-
style.width = config.width + "px";
|
|
6567
|
-
} else if (!isUndefined(autoWidthStr)) style.width = autoWidthStr;
|
|
6568
|
-
if (config.height) {
|
|
6569
|
-
if (isUndefined(autoHeightStr)) this.autoHeightStr = style.height || "";
|
|
6570
|
-
style.height = config.height + "px";
|
|
6571
|
-
} else if (!isUndefined(autoHeightStr)) style.height = autoHeightStr;
|
|
6572
|
-
} else {
|
|
6573
|
-
style.width = width + "px";
|
|
6574
|
-
style.height = height + "px";
|
|
6619
|
+
style.width = width + "px";
|
|
6620
|
+
style.height = height + "px";
|
|
6621
|
+
if (!this.unreal) {
|
|
6575
6622
|
this.view.width = Math.ceil(width * pixelRatio);
|
|
6576
6623
|
this.view.height = Math.ceil(height * pixelRatio);
|
|
6577
6624
|
}
|
|
@@ -6659,20 +6706,20 @@ var LeaferUI = function(exports) {
|
|
|
6659
6706
|
}
|
|
6660
6707
|
unrealCanvas() {
|
|
6661
6708
|
if (!this.unreal && this.parentView) {
|
|
6662
|
-
|
|
6709
|
+
let view = this.view;
|
|
6663
6710
|
if (view) view.remove();
|
|
6664
|
-
this.view =
|
|
6711
|
+
view = this.view = document.createElement("div");
|
|
6712
|
+
this.parentView.appendChild(this.view);
|
|
6713
|
+
view.classList.add("leafer-app-view");
|
|
6665
6714
|
this.unreal = true;
|
|
6666
6715
|
}
|
|
6667
6716
|
}
|
|
6668
6717
|
destroy() {
|
|
6669
|
-
|
|
6718
|
+
const {view: view} = this;
|
|
6719
|
+
if (view) {
|
|
6670
6720
|
this.stopAutoLayout();
|
|
6671
6721
|
this.stopListenPixelRatio();
|
|
6672
|
-
if (
|
|
6673
|
-
const view = this.view;
|
|
6674
|
-
if (view.parentElement) view.remove();
|
|
6675
|
-
}
|
|
6722
|
+
if (view.parentElement) view.remove();
|
|
6676
6723
|
super.destroy();
|
|
6677
6724
|
}
|
|
6678
6725
|
}
|
|
@@ -7296,6 +7343,8 @@ var LeaferUI = function(exports) {
|
|
|
7296
7343
|
}
|
|
7297
7344
|
}
|
|
7298
7345
|
Renderer.clipSpread = 10;
|
|
7346
|
+
const tempPoint = {};
|
|
7347
|
+
const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
|
|
7299
7348
|
const {hitRadiusPoint: hitRadiusPoint$1} = BoundsHelper;
|
|
7300
7349
|
class Picker {
|
|
7301
7350
|
constructor(target, selector) {
|
|
@@ -7421,15 +7470,15 @@ var LeaferUI = function(exports) {
|
|
|
7421
7470
|
this.eachFind(branch.children, branch.__onlyHitMask);
|
|
7422
7471
|
}
|
|
7423
7472
|
eachFind(children, hitMask) {
|
|
7424
|
-
let child, hit;
|
|
7473
|
+
let child, hit, data;
|
|
7425
7474
|
const {point: point} = this, len = children.length;
|
|
7426
7475
|
for (let i = len - 1; i > -1; i--) {
|
|
7427
|
-
child = children[i];
|
|
7428
|
-
if (!
|
|
7429
|
-
hit = child.
|
|
7476
|
+
child = children[i], data = child.__;
|
|
7477
|
+
if (!data.visible || hitMask && !data.mask) continue;
|
|
7478
|
+
hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint, point, data.hitRadius) : point);
|
|
7430
7479
|
if (child.isBranch) {
|
|
7431
7480
|
if (hit || child.__ignoreHitWorld) {
|
|
7432
|
-
if (child.isBranchLeaf &&
|
|
7481
|
+
if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
|
|
7433
7482
|
if (child.topChildren) this.eachFind(child.topChildren, false);
|
|
7434
7483
|
this.eachFind(child.children, child.__onlyHitMask);
|
|
7435
7484
|
if (child.isBranchLeaf) this.hitChild(child, point);
|
|
@@ -7960,7 +8009,7 @@ var LeaferUI = function(exports) {
|
|
|
7960
8009
|
if (stroke && !__fillAfterStroke) data.__isStrokes ? Paint.strokes(stroke, this, canvas, options) : Paint.stroke(stroke, this, canvas, options);
|
|
7961
8010
|
}
|
|
7962
8011
|
} else {
|
|
7963
|
-
if (data.
|
|
8012
|
+
if (data.__pathForRender) drawFast(this, canvas, options); else this.__drawFast(canvas, options);
|
|
7964
8013
|
}
|
|
7965
8014
|
},
|
|
7966
8015
|
__drawShape(canvas, options) {
|
|
@@ -8080,7 +8129,7 @@ var LeaferUI = function(exports) {
|
|
|
8080
8129
|
getPath(curve, pathForRender) {
|
|
8081
8130
|
this.__layout.update();
|
|
8082
8131
|
let path = pathForRender ? this.__.__pathForRender : this.__.path;
|
|
8083
|
-
if (!path) pen.set(path = []), this.__drawPathByBox(pen);
|
|
8132
|
+
if (!path) pen.set(path = []), this.__drawPathByBox(pen, !pathForRender);
|
|
8084
8133
|
return curve ? PathConvert.toCanvasData(path, true) : path;
|
|
8085
8134
|
}
|
|
8086
8135
|
getPathString(curve, pathForRender, floatLength) {
|
|
@@ -8108,17 +8157,18 @@ var LeaferUI = function(exports) {
|
|
|
8108
8157
|
}
|
|
8109
8158
|
__drawPath(canvas) {
|
|
8110
8159
|
canvas.beginPath();
|
|
8111
|
-
this.__drawPathByData(canvas, this.__.path);
|
|
8160
|
+
this.__drawPathByData(canvas, this.__.path, true);
|
|
8112
8161
|
}
|
|
8113
|
-
__drawPathByData(drawer, data) {
|
|
8114
|
-
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer);
|
|
8162
|
+
__drawPathByData(drawer, data, ignoreCornerRadius) {
|
|
8163
|
+
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer, ignoreCornerRadius);
|
|
8115
8164
|
}
|
|
8116
|
-
__drawPathByBox(drawer) {
|
|
8165
|
+
__drawPathByBox(drawer, ignoreCornerRadius) {
|
|
8117
8166
|
const {x: x, y: y, width: width, height: height} = this.__layout.boxBounds;
|
|
8118
|
-
if (this.__.cornerRadius) {
|
|
8167
|
+
if (this.__.cornerRadius && !ignoreCornerRadius) {
|
|
8119
8168
|
const {cornerRadius: cornerRadius} = this.__;
|
|
8120
8169
|
drawer.roundRect(x, y, width, height, isNumber(cornerRadius) ? [ cornerRadius ] : cornerRadius);
|
|
8121
8170
|
} else drawer.rect(x, y, width, height);
|
|
8171
|
+
drawer.closePath();
|
|
8122
8172
|
}
|
|
8123
8173
|
drawImagePlaceholder(_paint, canvas, renderOptions) {
|
|
8124
8174
|
Paint.fill(this.__.placeholderColor, this, canvas, renderOptions);
|
|
@@ -8305,6 +8355,9 @@ var LeaferUI = function(exports) {
|
|
|
8305
8355
|
get layoutLocked() {
|
|
8306
8356
|
return !this.layouter.running;
|
|
8307
8357
|
}
|
|
8358
|
+
get view() {
|
|
8359
|
+
return this.canvas && this.canvas.view;
|
|
8360
|
+
}
|
|
8308
8361
|
get FPS() {
|
|
8309
8362
|
return this.renderer ? this.renderer.FPS : 60;
|
|
8310
8363
|
}
|
|
@@ -8356,7 +8409,6 @@ var LeaferUI = function(exports) {
|
|
|
8356
8409
|
this.__controllers.push(this.renderer = Creator.renderer(this, canvas, config), this.watcher = Creator.watcher(this, config), this.layouter = Creator.layouter(this, config));
|
|
8357
8410
|
if (this.isApp) this.__setApp();
|
|
8358
8411
|
this.__checkAutoLayout();
|
|
8359
|
-
this.view = canvas.view;
|
|
8360
8412
|
if (!parentApp) {
|
|
8361
8413
|
this.selector = Creator.selector(this);
|
|
8362
8414
|
this.interaction = Creator.interaction(this, canvas, this.selector, config);
|
|
@@ -8636,7 +8688,7 @@ var LeaferUI = function(exports) {
|
|
|
8636
8688
|
if (this.canvasManager) this.canvasManager.destroy();
|
|
8637
8689
|
}
|
|
8638
8690
|
if (this.canvas) this.canvas.destroy();
|
|
8639
|
-
this.config.view = this.
|
|
8691
|
+
this.config.view = this.parentApp = null;
|
|
8640
8692
|
if (this.userConfig) this.userConfig.view = null;
|
|
8641
8693
|
super.destroy();
|
|
8642
8694
|
setTimeout(() => {
|
|
@@ -8788,7 +8840,6 @@ var LeaferUI = function(exports) {
|
|
|
8788
8840
|
if (startAngle || endAngle) {
|
|
8789
8841
|
if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false);
|
|
8790
8842
|
ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
8791
|
-
if (innerRadius < 1) closePath$2(path);
|
|
8792
8843
|
} else {
|
|
8793
8844
|
if (innerRadius < 1) {
|
|
8794
8845
|
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
@@ -8796,16 +8847,16 @@ var LeaferUI = function(exports) {
|
|
|
8796
8847
|
}
|
|
8797
8848
|
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
8798
8849
|
}
|
|
8799
|
-
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
8800
8850
|
} else {
|
|
8801
8851
|
if (startAngle || endAngle) {
|
|
8802
8852
|
moveTo$3(path, rx, ry);
|
|
8803
8853
|
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
8804
|
-
closePath$2(path);
|
|
8805
8854
|
} else {
|
|
8806
8855
|
ellipse(path, rx, ry, rx, ry);
|
|
8807
8856
|
}
|
|
8808
8857
|
}
|
|
8858
|
+
closePath$2(path);
|
|
8859
|
+
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
8809
8860
|
}
|
|
8810
8861
|
};
|
|
8811
8862
|
__decorate([ dataProcessor(EllipseData) ], exports.Ellipse.prototype, "__", void 0);
|
|
@@ -9560,6 +9611,7 @@ var LeaferUI = function(exports) {
|
|
|
9560
9611
|
exports.MoveEvent.BEFORE_MOVE = "move.before_move";
|
|
9561
9612
|
exports.MoveEvent.START = "move.start";
|
|
9562
9613
|
exports.MoveEvent.MOVE = "move";
|
|
9614
|
+
exports.MoveEvent.DRAG_ANIMATE = "move.drag_animate";
|
|
9563
9615
|
exports.MoveEvent.END = "move.end";
|
|
9564
9616
|
exports.MoveEvent = __decorate([ registerUIEvent() ], exports.MoveEvent);
|
|
9565
9617
|
exports.TouchEvent = class TouchEvent extends UIEvent {};
|
|
@@ -9627,6 +9679,7 @@ var LeaferUI = function(exports) {
|
|
|
9627
9679
|
ctrlKey: e.ctrlKey,
|
|
9628
9680
|
shiftKey: e.shiftKey,
|
|
9629
9681
|
metaKey: e.metaKey,
|
|
9682
|
+
time: Date.now(),
|
|
9630
9683
|
buttons: isUndefined(e.buttons) ? 1 : e.buttons === 0 ? pointerUpButtons : e.buttons,
|
|
9631
9684
|
origin: e
|
|
9632
9685
|
};
|
|
@@ -9658,6 +9711,7 @@ var LeaferUI = function(exports) {
|
|
|
9658
9711
|
const {getDragEventData: getDragEventData, getDropEventData: getDropEventData, getSwipeEventData: getSwipeEventData} = InteractionHelper;
|
|
9659
9712
|
class Dragger {
|
|
9660
9713
|
constructor(interaction) {
|
|
9714
|
+
this.dragDataList = [];
|
|
9661
9715
|
this.interaction = interaction;
|
|
9662
9716
|
}
|
|
9663
9717
|
setDragData(data) {
|
|
@@ -9720,6 +9774,7 @@ var LeaferUI = function(exports) {
|
|
|
9720
9774
|
this.dragData = getDragEventData(downData, dragData, data);
|
|
9721
9775
|
if (throughPath) this.dragData.throughPath = throughPath;
|
|
9722
9776
|
this.dragData.path = path;
|
|
9777
|
+
this.dragDataList.push(this.dragData);
|
|
9723
9778
|
if (this.moving) {
|
|
9724
9779
|
data.moving = true;
|
|
9725
9780
|
this.dragData.moveType = "drag";
|
|
@@ -9770,9 +9825,9 @@ var LeaferUI = function(exports) {
|
|
|
9770
9825
|
interaction.emit(exports.DragEvent.ENTER, data, path, dragEnterPath);
|
|
9771
9826
|
this.dragEnterPath = path;
|
|
9772
9827
|
}
|
|
9773
|
-
dragEnd(data
|
|
9828
|
+
dragEnd(data) {
|
|
9774
9829
|
if (!this.dragging && !this.moving) return;
|
|
9775
|
-
if (this.checkDragEndAnimate(data
|
|
9830
|
+
if (this.checkDragEndAnimate(data)) return;
|
|
9776
9831
|
this.dragEndReal(data);
|
|
9777
9832
|
}
|
|
9778
9833
|
dragEndReal(data) {
|
|
@@ -9814,11 +9869,13 @@ var LeaferUI = function(exports) {
|
|
|
9814
9869
|
}
|
|
9815
9870
|
dragReset() {
|
|
9816
9871
|
exports.DragEvent.list = exports.DragEvent.data = this.draggableList = this.dragData = this.downData = this.dragOverPath = this.dragEnterPath = null;
|
|
9872
|
+
this.dragDataList = [];
|
|
9817
9873
|
}
|
|
9818
9874
|
checkDragEndAnimate(_data, _speed) {
|
|
9819
9875
|
return false;
|
|
9820
9876
|
}
|
|
9821
9877
|
animate(_func, _off) {}
|
|
9878
|
+
stopAnimate() {}
|
|
9822
9879
|
checkDragOut(_data) {}
|
|
9823
9880
|
autoMoveOnDragOut(_data) {}
|
|
9824
9881
|
autoMoveCancel() {}
|
|
@@ -10203,6 +10260,9 @@ var LeaferUI = function(exports) {
|
|
|
10203
10260
|
this.pointerHover(hoverData);
|
|
10204
10261
|
}
|
|
10205
10262
|
}
|
|
10263
|
+
stopDragAnimate() {
|
|
10264
|
+
this.dragger.stopAnimate();
|
|
10265
|
+
}
|
|
10206
10266
|
updateDownData(data, options, merge) {
|
|
10207
10267
|
const {downData: downData} = this;
|
|
10208
10268
|
if (!data && downData) data = downData;
|
|
@@ -10381,28 +10441,27 @@ var LeaferUI = function(exports) {
|
|
|
10381
10441
|
Platform.getSelector = function(leaf) {
|
|
10382
10442
|
return leaf.leafer ? leaf.leafer.selector : Platform.selector || (Platform.selector = Creator.selector());
|
|
10383
10443
|
};
|
|
10384
|
-
const {toInnerRadiusPointOf: toInnerRadiusPointOf,
|
|
10444
|
+
const {toInnerRadiusPointOf: toInnerRadiusPointOf, copyRadiusPoint: copyRadiusPoint} = PointHelper;
|
|
10385
10445
|
const {hitRadiusPoint: hitRadiusPoint, hitPoint: hitPoint} = BoundsHelper;
|
|
10386
10446
|
const inner = {}, worldRadiusPoint = {};
|
|
10387
10447
|
const leaf = exports.Leaf.prototype;
|
|
10388
10448
|
leaf.hit = function(worldPoint, hitRadius = 0) {
|
|
10389
10449
|
this.updateLayout();
|
|
10390
|
-
|
|
10391
|
-
setRadius(worldRadiusPoint, hitRadius);
|
|
10450
|
+
copyRadiusPoint(worldRadiusPoint, worldPoint, hitRadius);
|
|
10392
10451
|
const world = this.__world;
|
|
10393
10452
|
if (hitRadius ? !hitRadiusPoint(world, worldRadiusPoint) : !hitPoint(world, worldRadiusPoint)) return false;
|
|
10394
10453
|
return this.isBranch ? Platform.getSelector(this).hitPoint(Object.assign({}, worldRadiusPoint), hitRadius, {
|
|
10395
10454
|
target: this
|
|
10396
10455
|
}) : this.__hitWorld(worldRadiusPoint);
|
|
10397
10456
|
};
|
|
10398
|
-
leaf.__hitWorld = function(point) {
|
|
10457
|
+
leaf.__hitWorld = function(point, forceHitFill) {
|
|
10399
10458
|
const data = this.__;
|
|
10400
10459
|
if (!data.hitSelf) return false;
|
|
10401
10460
|
const world = this.__world, layout = this.__layout;
|
|
10402
10461
|
const isSmall = world.width < 10 && world.height < 10;
|
|
10403
10462
|
if (data.hitRadius) {
|
|
10404
|
-
|
|
10405
|
-
|
|
10463
|
+
copyRadiusPoint(inner, point, data.hitRadius);
|
|
10464
|
+
point = inner;
|
|
10406
10465
|
}
|
|
10407
10466
|
toInnerRadiusPointOf(point, world, inner);
|
|
10408
10467
|
if (data.hitBox || isSmall) {
|
|
@@ -10413,7 +10472,7 @@ var LeaferUI = function(exports) {
|
|
|
10413
10472
|
this.__updateHitCanvas();
|
|
10414
10473
|
if (!layout.boundsChanged) layout.hitCanvasChanged = false;
|
|
10415
10474
|
}
|
|
10416
|
-
return this.__hit(inner);
|
|
10475
|
+
return this.__hit(inner, forceHitFill);
|
|
10417
10476
|
};
|
|
10418
10477
|
leaf.__hitFill = function(inner) {
|
|
10419
10478
|
const h = this.__hitCanvas;
|
|
@@ -10472,12 +10531,12 @@ var LeaferUI = function(exports) {
|
|
|
10472
10531
|
this.__drawHitPath(h);
|
|
10473
10532
|
h.setStrokeOptions(data);
|
|
10474
10533
|
};
|
|
10475
|
-
ui$1.__hit = function(inner) {
|
|
10534
|
+
ui$1.__hit = function(inner, forceHitFill) {
|
|
10476
10535
|
if (this.__box && this.__box.__hit(inner)) return true;
|
|
10477
10536
|
const data = this.__;
|
|
10478
10537
|
if (data.__isHitPixel && this.__hitPixel(inner)) return true;
|
|
10479
10538
|
const {hitFill: hitFill} = data;
|
|
10480
|
-
const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all";
|
|
10539
|
+
const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all" || forceHitFill;
|
|
10481
10540
|
if (needHitFillPath && this.__hitFill(inner)) return true;
|
|
10482
10541
|
const {hitStroke: hitStroke, __maxStrokeWidth: strokeWidth} = data;
|
|
10483
10542
|
const needHitStrokePath = data.stroke && (hitStroke === "path" || hitStroke === "pixel" && !data.__isAlphaPixelStroke) || hitStroke === "all";
|
|
@@ -11468,10 +11527,12 @@ var LeaferUI = function(exports) {
|
|
|
11468
11527
|
function createPatternTask(paint, ui, canvas, renderOptions) {
|
|
11469
11528
|
if (!paint.patternTask) {
|
|
11470
11529
|
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
11471
|
-
paint
|
|
11472
|
-
if (canvas.bounds.hit(ui.__nowWorld)) PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
11530
|
+
PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
11473
11531
|
ui.forceUpdate("surface");
|
|
11474
|
-
}),
|
|
11532
|
+
}), 0, () => {
|
|
11533
|
+
paint.patternTask = null;
|
|
11534
|
+
return canvas.bounds.hit(ui.__nowWorld);
|
|
11535
|
+
});
|
|
11475
11536
|
}
|
|
11476
11537
|
}
|
|
11477
11538
|
function createPattern(paint, ui, canvas, renderOptions) {
|
|
@@ -12576,7 +12637,7 @@ var LeaferUI = function(exports) {
|
|
|
12576
12637
|
exports.surfaceType = surfaceType;
|
|
12577
12638
|
exports.tempBounds = tempBounds$2;
|
|
12578
12639
|
exports.tempMatrix = tempMatrix$2;
|
|
12579
|
-
exports.tempPoint = tempPoint$
|
|
12640
|
+
exports.tempPoint = tempPoint$3;
|
|
12580
12641
|
exports.tryToNumber = tryToNumber;
|
|
12581
12642
|
exports.useCanvas = useCanvas;
|
|
12582
12643
|
exports.useModule = useModule;
|