@leafer/worker 2.0.2 → 2.0.4
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/worker.cjs +22 -0
- package/dist/worker.esm.js +4 -0
- package/dist/worker.esm.min.js +1 -1
- package/dist/worker.esm.min.js.map +1 -1
- package/dist/worker.js +502 -183
- package/dist/worker.min.cjs +1 -1
- package/dist/worker.min.cjs.map +1 -1
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +564 -185
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +26 -24
- package/src/index.ts +3 -0
- package/types/index.d.ts +2 -0
package/dist/worker.module.js
CHANGED
|
@@ -252,6 +252,7 @@ class LeafData {
|
|
|
252
252
|
}
|
|
253
253
|
destroy() {
|
|
254
254
|
this.__input = this.__middle = null;
|
|
255
|
+
if (this.__complexData) this.__complexData.destroy();
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
|
|
@@ -350,6 +351,8 @@ const {set: set$2, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumbe
|
|
|
350
351
|
|
|
351
352
|
const {round: round$6, pow: pow$2, max: max$6, floor: floor$3, PI: PI$4} = Math;
|
|
352
353
|
|
|
354
|
+
const tempScaleData$1 = {};
|
|
355
|
+
|
|
353
356
|
const MathHelper = {
|
|
354
357
|
within(value, min, max) {
|
|
355
358
|
if (isObject(min)) max = min.max, min = min.min;
|
|
@@ -393,6 +396,24 @@ const MathHelper = {
|
|
|
393
396
|
} else if (scale) MathHelper.assignScale(scaleData, scale);
|
|
394
397
|
return scaleData;
|
|
395
398
|
},
|
|
399
|
+
getScaleFixedData(worldScaleData, scaleFixed, unscale, abs, _localScaleData) {
|
|
400
|
+
let {scaleX: scaleX, scaleY: scaleY} = worldScaleData;
|
|
401
|
+
if (abs || scaleFixed) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
|
|
402
|
+
if (scaleFixed) {
|
|
403
|
+
if (scaleFixed === true) {
|
|
404
|
+
scaleX = scaleY = unscale ? 1 : 1 / scaleX;
|
|
405
|
+
} else {
|
|
406
|
+
let minScale;
|
|
407
|
+
if (isNumber(scaleFixed)) minScale = scaleFixed; else if (scaleFixed === "zoom-in") minScale = 1;
|
|
408
|
+
if (minScale) {
|
|
409
|
+
if (scaleX > minScale || scaleY > minScale) scaleX = scaleY = unscale ? 1 : 1 / scaleX; else scaleX = scaleY = unscale ? 1 : 1 / minScale;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
tempScaleData$1.scaleX = scaleX;
|
|
414
|
+
tempScaleData$1.scaleY = scaleY;
|
|
415
|
+
return tempScaleData$1;
|
|
416
|
+
},
|
|
396
417
|
assignScale(scaleData, scale) {
|
|
397
418
|
if (isNumber(scale)) {
|
|
398
419
|
scaleData.scaleX = scaleData.scaleY = scale;
|
|
@@ -889,8 +910,8 @@ const PointHelper = {
|
|
|
889
910
|
if (isObject(originPoints[0])) points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
890
911
|
return points;
|
|
891
912
|
},
|
|
892
|
-
isSame(t, point) {
|
|
893
|
-
return float$5(t.x) === float$5(point.x) && float$5(t.y) === float$5(point.y);
|
|
913
|
+
isSame(t, point, quick) {
|
|
914
|
+
return quick ? t.x === point.x && t.y === point.y : float$5(t.x) === float$5(point.x) && float$5(t.y) === float$5(point.y);
|
|
894
915
|
},
|
|
895
916
|
reset(t) {
|
|
896
917
|
P$7.reset(t);
|
|
@@ -965,8 +986,8 @@ class Point {
|
|
|
965
986
|
getAtan2(to) {
|
|
966
987
|
return PointHelper.getAtan2(this, to);
|
|
967
988
|
}
|
|
968
|
-
isSame(point) {
|
|
969
|
-
return PointHelper.isSame(this, point);
|
|
989
|
+
isSame(point, quick) {
|
|
990
|
+
return PointHelper.isSame(this, point, quick);
|
|
970
991
|
}
|
|
971
992
|
reset() {
|
|
972
993
|
PointHelper.reset(this);
|
|
@@ -1222,9 +1243,9 @@ const AroundHelper = {
|
|
|
1222
1243
|
}
|
|
1223
1244
|
if (!onlyBoxSize) to.x += box.x, to.y += box.y;
|
|
1224
1245
|
},
|
|
1225
|
-
getPoint(around, box, to) {
|
|
1246
|
+
getPoint(around, box, to, onlyBoxSize = true) {
|
|
1226
1247
|
if (!to) to = {};
|
|
1227
|
-
AroundHelper.toPoint(around, box, to,
|
|
1248
|
+
AroundHelper.toPoint(around, box, to, onlyBoxSize);
|
|
1228
1249
|
return to;
|
|
1229
1250
|
}
|
|
1230
1251
|
};
|
|
@@ -1491,6 +1512,9 @@ const BoundsHelper = {
|
|
|
1491
1512
|
y: y + height
|
|
1492
1513
|
} ];
|
|
1493
1514
|
},
|
|
1515
|
+
getPoint(t, around, onlyBoxSize = false, to) {
|
|
1516
|
+
return AroundHelper.getPoint(around, t, to, onlyBoxSize);
|
|
1517
|
+
},
|
|
1494
1518
|
hitRadiusPoint(t, point, pointMatrix) {
|
|
1495
1519
|
if (pointMatrix) point = PointHelper.tempToInnerRadiusPointOf(point, pointMatrix);
|
|
1496
1520
|
return point.x >= t.x - point.radiusX && point.x <= t.x + t.width + point.radiusX && (point.y >= t.y - point.radiusY && point.y <= t.y + t.height + point.radiusY);
|
|
@@ -1662,6 +1686,9 @@ class Bounds {
|
|
|
1662
1686
|
getPoints() {
|
|
1663
1687
|
return BoundsHelper.getPoints(this);
|
|
1664
1688
|
}
|
|
1689
|
+
getPoint(around, onlyBoxSize, to) {
|
|
1690
|
+
return BoundsHelper.getPoint(this, around, onlyBoxSize, to);
|
|
1691
|
+
}
|
|
1665
1692
|
hitPoint(point, pointMatrix) {
|
|
1666
1693
|
return BoundsHelper.hitPoint(this, point, pointMatrix);
|
|
1667
1694
|
}
|
|
@@ -2767,10 +2794,10 @@ const BezierHelper = {
|
|
|
2767
2794
|
const centerY = y1 + c * sin$4(startRadian + totalRadian / 2 + PI_2 * sign);
|
|
2768
2795
|
startRadian -= PI_2 * sign;
|
|
2769
2796
|
endRadian -= PI_2 * sign;
|
|
2770
|
-
return ellipse$
|
|
2797
|
+
return ellipse$8(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
|
|
2771
2798
|
},
|
|
2772
2799
|
arc(data, x, y, radius, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
|
|
2773
|
-
return ellipse$
|
|
2800
|
+
return ellipse$8(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
|
|
2774
2801
|
},
|
|
2775
2802
|
ellipse(data, cx, cy, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
|
|
2776
2803
|
const rotationRadian = rotation * OneRadian;
|
|
@@ -2872,11 +2899,11 @@ const BezierHelper = {
|
|
|
2872
2899
|
}
|
|
2873
2900
|
};
|
|
2874
2901
|
|
|
2875
|
-
const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$
|
|
2902
|
+
const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$8} = BezierHelper;
|
|
2876
2903
|
|
|
2877
2904
|
const {sin: sin$3, cos: cos$3, sqrt: sqrt$2, atan2: atan2} = Math;
|
|
2878
2905
|
|
|
2879
|
-
const {ellipse: ellipse$
|
|
2906
|
+
const {ellipse: ellipse$7} = BezierHelper;
|
|
2880
2907
|
|
|
2881
2908
|
const EllipseHelper = {
|
|
2882
2909
|
ellipticalArc(data, fromX, fromY, radiusX, radiusY, rotation, largeFlag, sweepFlag, toX, toY, curveMode) {
|
|
@@ -2914,7 +2941,7 @@ const EllipseHelper = {
|
|
|
2914
2941
|
const centerY = fromY + halfY + rotationSin * cx + rotationCos * cy;
|
|
2915
2942
|
const anticlockwise = totalRadian < 0 ? 1 : 0;
|
|
2916
2943
|
if (curveMode || Platform.ellipseToCurve) {
|
|
2917
|
-
ellipse$
|
|
2944
|
+
ellipse$7(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
|
|
2918
2945
|
} else {
|
|
2919
2946
|
if (radiusX === radiusY && !rotation) {
|
|
2920
2947
|
data.push(PathCommandMap.O, centerX, centerY, radiusX, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
|
|
@@ -2936,7 +2963,7 @@ const PathCommandNodeHelper = {
|
|
|
2936
2963
|
|
|
2937
2964
|
const {M: M$9, m: m, L: L$9, l: l, H: H, h: h, V: V, v: v, C: C$7, c: c, S: S$1, s: s, Q: Q$6, q: q, T: T, t: t, A: A, a: a, Z: Z$7, z: z, N: N$5, D: D$6, X: X$5, G: G$5, F: F$6, O: O$6, P: P$5, U: U$5} = PathCommandMap;
|
|
2938
2965
|
|
|
2939
|
-
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$
|
|
2966
|
+
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$6, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
2940
2967
|
|
|
2941
2968
|
const {ellipticalArc: ellipticalArc} = EllipseHelper;
|
|
2942
2969
|
|
|
@@ -3169,14 +3196,14 @@ const PathConvert = {
|
|
|
3169
3196
|
break;
|
|
3170
3197
|
|
|
3171
3198
|
case G$5:
|
|
3172
|
-
ellipse$
|
|
3199
|
+
ellipse$6(curveMode ? data : copyData(data, old, i, 9), old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], old[i + 6], old[i + 7], old[i + 8], null, setEndPoint$1);
|
|
3173
3200
|
x = setEndPoint$1.x;
|
|
3174
3201
|
y = setEndPoint$1.y;
|
|
3175
3202
|
i += 9;
|
|
3176
3203
|
break;
|
|
3177
3204
|
|
|
3178
3205
|
case F$6:
|
|
3179
|
-
curveMode ? ellipse$
|
|
3206
|
+
curveMode ? ellipse$6(data, old[i + 1], old[i + 2], old[i + 3], old[i + 4], 0, 0, 360, false) : copyData(data, old, i, 5);
|
|
3180
3207
|
x = old[i + 1] + old[i + 3];
|
|
3181
3208
|
y = old[i + 2];
|
|
3182
3209
|
i += 5;
|
|
@@ -3330,7 +3357,7 @@ const PathCommandDataHelper = {
|
|
|
3330
3357
|
drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
3331
3358
|
BezierHelper.ellipse(null, x, y, radiusX, radiusY, isNull(rotation) ? 0 : rotation, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
|
|
3332
3359
|
data.push(M$8, startPoint.x, startPoint.y);
|
|
3333
|
-
ellipse$
|
|
3360
|
+
ellipse$5(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
3334
3361
|
},
|
|
3335
3362
|
drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
|
|
3336
3363
|
BezierHelper.arc(null, x, y, radius, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
|
|
@@ -3342,9 +3369,9 @@ const PathCommandDataHelper = {
|
|
|
3342
3369
|
}
|
|
3343
3370
|
};
|
|
3344
3371
|
|
|
3345
|
-
const {ellipse: ellipse$
|
|
3372
|
+
const {ellipse: ellipse$5, arc: arc$2} = PathCommandDataHelper;
|
|
3346
3373
|
|
|
3347
|
-
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$
|
|
3374
|
+
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$4, arc: arc$1, arcTo: arcTo$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
|
|
3348
3375
|
|
|
3349
3376
|
class PathCreator {
|
|
3350
3377
|
set path(value) {
|
|
@@ -3401,7 +3428,7 @@ class PathCreator {
|
|
|
3401
3428
|
return this;
|
|
3402
3429
|
}
|
|
3403
3430
|
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
3404
|
-
ellipse$
|
|
3431
|
+
ellipse$4(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
3405
3432
|
this.paint();
|
|
3406
3433
|
return this;
|
|
3407
3434
|
}
|
|
@@ -3523,7 +3550,7 @@ const PathDrawer = {
|
|
|
3523
3550
|
|
|
3524
3551
|
const {M: M$6, L: L$6, C: C$4, Q: Q$3, Z: Z$4, N: N$2, D: D$3, X: X$2, G: G$2, F: F$3, O: O$3, P: P$2, U: U$2} = PathCommandMap;
|
|
3525
3552
|
|
|
3526
|
-
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$
|
|
3553
|
+
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$3} = BezierHelper;
|
|
3527
3554
|
|
|
3528
3555
|
const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
|
|
3529
3556
|
|
|
@@ -3606,7 +3633,7 @@ const PathBounds = {
|
|
|
3606
3633
|
break;
|
|
3607
3634
|
|
|
3608
3635
|
case G$2:
|
|
3609
|
-
ellipse$
|
|
3636
|
+
ellipse$3(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);
|
|
3610
3637
|
i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3611
3638
|
x = setEndPoint.x;
|
|
3612
3639
|
y = setEndPoint.y;
|
|
@@ -4102,6 +4129,7 @@ const ImageManager = {
|
|
|
4102
4129
|
return image;
|
|
4103
4130
|
},
|
|
4104
4131
|
recycle(image) {
|
|
4132
|
+
if (image.parent) image = image.parent;
|
|
4105
4133
|
image.use--;
|
|
4106
4134
|
setTimeout(() => {
|
|
4107
4135
|
if (!image.use) {
|
|
@@ -4270,8 +4298,10 @@ class LeaferImage {
|
|
|
4270
4298
|
return undefined;
|
|
4271
4299
|
}
|
|
4272
4300
|
clearLevels(_checkUse) {}
|
|
4301
|
+
destroyFilter() {}
|
|
4273
4302
|
destroy() {
|
|
4274
4303
|
this.clearLevels();
|
|
4304
|
+
this.destroyFilter();
|
|
4275
4305
|
const {view: view} = this;
|
|
4276
4306
|
if (view && view.close) view.close();
|
|
4277
4307
|
this.config = {
|
|
@@ -4468,7 +4498,6 @@ function dimType(defaultValue) {
|
|
|
4468
4498
|
if (this.__setAttr(key, value)) {
|
|
4469
4499
|
const data = this.__;
|
|
4470
4500
|
DataHelper.stintSet(data, "__useDim", data.dim || data.bright || data.dimskip);
|
|
4471
|
-
this.__layout.surfaceChange();
|
|
4472
4501
|
}
|
|
4473
4502
|
}
|
|
4474
4503
|
}));
|
|
@@ -4518,7 +4547,6 @@ function sortType(defaultValue) {
|
|
|
4518
4547
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4519
4548
|
set(value) {
|
|
4520
4549
|
if (this.__setAttr(key, value)) {
|
|
4521
|
-
this.__layout.surfaceChange();
|
|
4522
4550
|
this.waitParent(() => {
|
|
4523
4551
|
this.parent.__layout.childrenSortChange();
|
|
4524
4552
|
});
|
|
@@ -4555,7 +4583,6 @@ function hitType(defaultValue) {
|
|
|
4555
4583
|
set(value) {
|
|
4556
4584
|
if (this.__setAttr(key, value)) {
|
|
4557
4585
|
this.__layout.hitCanvasChanged = true;
|
|
4558
|
-
if (Debug.showBounds === "hit") this.__layout.surfaceChange();
|
|
4559
4586
|
if (this.leafer) this.leafer.updateCursor();
|
|
4560
4587
|
}
|
|
4561
4588
|
}
|
|
@@ -4761,6 +4788,10 @@ const LeafHelper = {
|
|
|
4761
4788
|
if (layout.stateStyleChanged) leaf.updateState();
|
|
4762
4789
|
if (layout.opacityChanged) updateAllWorldOpacity(leaf);
|
|
4763
4790
|
leaf.__updateChange();
|
|
4791
|
+
if (layout.surfaceChanged) {
|
|
4792
|
+
if (leaf.__hasComplex) L$4.updateComplex(leaf);
|
|
4793
|
+
layout.surfaceChanged = false;
|
|
4794
|
+
}
|
|
4764
4795
|
},
|
|
4765
4796
|
updateAllChange(leaf) {
|
|
4766
4797
|
updateChange$1(leaf);
|
|
@@ -4785,6 +4816,9 @@ const LeafHelper = {
|
|
|
4785
4816
|
if (!fromWorld) fromWorld = leaf.__nowWorld;
|
|
4786
4817
|
if (leaf.__worldFlipped || Platform.fullImageShadow) currentCanvas.copyWorldByReset(fromCanvas, fromWorld, leaf.__nowWorld, blendMode, onlyResetTransform); else currentCanvas.copyWorldToInner(fromCanvas, fromWorld, leaf.__layout.renderBounds, blendMode);
|
|
4787
4818
|
},
|
|
4819
|
+
renderComplex(_leaf, _canvas, _options) {},
|
|
4820
|
+
updateComplex(_leaf) {},
|
|
4821
|
+
checkComplex(_leaf) {},
|
|
4788
4822
|
moveWorld(t, x, y = 0, isInnerPoint, transition) {
|
|
4789
4823
|
const local = isObject(x) ? Object.assign({}, x) : {
|
|
4790
4824
|
x: x,
|
|
@@ -4896,6 +4930,9 @@ const LeafHelper = {
|
|
|
4896
4930
|
divideParent(matrix$3, relative.scrollWorldTransform);
|
|
4897
4931
|
return temp ? matrix$3 : Object.assign({}, matrix$3);
|
|
4898
4932
|
},
|
|
4933
|
+
updateScaleFixedWorld(_t) {},
|
|
4934
|
+
updateOuterBounds(_t) {},
|
|
4935
|
+
cacheId(_t) {},
|
|
4899
4936
|
drop(t, parent, index, resize) {
|
|
4900
4937
|
t.setTransform(L$4.getRelativeWorld(t, parent, true), resize);
|
|
4901
4938
|
parent.add(t, index);
|
|
@@ -4946,7 +4983,8 @@ const LeafBoundsHelper = {
|
|
|
4946
4983
|
return target.__.eraser || target.__.visible === 0 ? null : target.__layout.localStrokeBounds;
|
|
4947
4984
|
},
|
|
4948
4985
|
localRenderBounds(target) {
|
|
4949
|
-
|
|
4986
|
+
const {__: __, __layout: __layout} = target;
|
|
4987
|
+
return __.eraser || __.visible === 0 ? null : __layout.localOuterBounds || __layout.localRenderBounds;
|
|
4950
4988
|
},
|
|
4951
4989
|
maskLocalBoxBounds(target, index) {
|
|
4952
4990
|
return checkMask(target, index) && target.__localBoxBounds;
|
|
@@ -4955,7 +4993,8 @@ const LeafBoundsHelper = {
|
|
|
4955
4993
|
return checkMask(target, index) && target.__layout.localStrokeBounds;
|
|
4956
4994
|
},
|
|
4957
4995
|
maskLocalRenderBounds(target, index) {
|
|
4958
|
-
|
|
4996
|
+
const {__layout: __layout} = target;
|
|
4997
|
+
return checkMask(target, index) && (__layout.localOuterBounds || __layout.localRenderBounds);
|
|
4959
4998
|
},
|
|
4960
4999
|
excludeRenderBounds(child, options) {
|
|
4961
5000
|
if (options.bounds && !options.bounds.hit(child.__world, options.matrix)) return true;
|
|
@@ -5079,12 +5118,12 @@ const BranchHelper = {
|
|
|
5079
5118
|
w.height *= scaleY;
|
|
5080
5119
|
w.scaleX *= scaleX;
|
|
5081
5120
|
w.scaleY *= scaleY;
|
|
5082
|
-
if (branch.isBranch) scale$
|
|
5121
|
+
if (branch.isBranch) scale$3(branch, x, y, scaleX, scaleY, a, b);
|
|
5083
5122
|
}
|
|
5084
5123
|
}
|
|
5085
5124
|
};
|
|
5086
5125
|
|
|
5087
|
-
const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$
|
|
5126
|
+
const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$3} = BranchHelper;
|
|
5088
5127
|
|
|
5089
5128
|
const WaitHelper = {
|
|
5090
5129
|
run(wait) {
|
|
@@ -5475,7 +5514,6 @@ class LeafLayout {
|
|
|
5475
5514
|
}
|
|
5476
5515
|
opacityChange() {
|
|
5477
5516
|
this.opacityChanged = true;
|
|
5478
|
-
this.surfaceChanged || this.surfaceChange();
|
|
5479
5517
|
}
|
|
5480
5518
|
childrenSortChange() {
|
|
5481
5519
|
if (!this.childrenSortChanged) {
|
|
@@ -5582,7 +5620,7 @@ class BoundsEvent extends Event {
|
|
|
5582
5620
|
}
|
|
5583
5621
|
}
|
|
5584
5622
|
static emitWorld(leaf) {
|
|
5585
|
-
if (leaf.leaferIsReady) leaf.emit(WORLD,
|
|
5623
|
+
if (leaf.leaferIsReady) leaf.emit(WORLD, leaf);
|
|
5586
5624
|
}
|
|
5587
5625
|
}
|
|
5588
5626
|
|
|
@@ -5968,6 +6006,7 @@ const LeafMatrix = {
|
|
|
5968
6006
|
const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
|
|
5969
6007
|
multiplyParent$2(this.__local || __layout, parent ? parent.__scrollWorld || parent.__world : defaultWorld, __world, !!__layout.affectScaleOrRotation, __);
|
|
5970
6008
|
if (__scrollWorld) translateInner(Object.assign(__scrollWorld, __world), __.scrollX, __.scrollY);
|
|
6009
|
+
if (__layout.scaleFixed) LeafHelper.updateScaleFixedWorld(this);
|
|
5971
6010
|
},
|
|
5972
6011
|
__updateLocalMatrix() {
|
|
5973
6012
|
if (this.__local) {
|
|
@@ -5993,7 +6032,7 @@ const {updateMatrix: updateMatrix$3, updateAllMatrix: updateAllMatrix$3} = LeafH
|
|
|
5993
6032
|
|
|
5994
6033
|
const {updateBounds: updateBounds$2} = BranchHelper;
|
|
5995
6034
|
|
|
5996
|
-
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$
|
|
6035
|
+
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$4, copy: copy$6} = BoundsHelper;
|
|
5997
6036
|
|
|
5998
6037
|
const {toBounds: toBounds$1} = PathBounds;
|
|
5999
6038
|
|
|
@@ -6001,6 +6040,7 @@ const LeafBounds = {
|
|
|
6001
6040
|
__updateWorldBounds() {
|
|
6002
6041
|
const {__layout: __layout, __world: __world} = this;
|
|
6003
6042
|
toOuterOf$2(__layout.renderBounds, __world, __world);
|
|
6043
|
+
if (this.__hasComplex) LeafHelper.checkComplex(this);
|
|
6004
6044
|
if (__layout.resized) {
|
|
6005
6045
|
if (__layout.resized === "inner") this.__onUpdateSize();
|
|
6006
6046
|
if (this.__hasLocalEvent) BoundsEvent.emitLocal(this);
|
|
@@ -6050,6 +6090,7 @@ const LeafBounds = {
|
|
|
6050
6090
|
layout.renderChanged = undefined;
|
|
6051
6091
|
if (this.parent) this.parent.__layout.renderChange();
|
|
6052
6092
|
}
|
|
6093
|
+
if (layout.outerScale) LeafHelper.updateOuterBounds(this);
|
|
6053
6094
|
layout.resized || (layout.resized = "local");
|
|
6054
6095
|
layout.boundsChanged = undefined;
|
|
6055
6096
|
},
|
|
@@ -6100,11 +6141,11 @@ const LeafBounds = {
|
|
|
6100
6141
|
},
|
|
6101
6142
|
__updateStrokeBounds(_bounds) {
|
|
6102
6143
|
const layout = this.__layout;
|
|
6103
|
-
copyAndSpread$
|
|
6144
|
+
copyAndSpread$4(layout.strokeBounds, layout.boxBounds, layout.strokeBoxSpread);
|
|
6104
6145
|
},
|
|
6105
6146
|
__updateRenderBounds(_bounds) {
|
|
6106
6147
|
const layout = this.__layout, {renderSpread: renderSpread} = layout;
|
|
6107
|
-
isNumber(renderSpread) && renderSpread <= 0 ? copy$6(layout.renderBounds, layout.strokeBounds) : copyAndSpread$
|
|
6148
|
+
isNumber(renderSpread) && renderSpread <= 0 ? copy$6(layout.renderBounds, layout.strokeBounds) : copyAndSpread$4(layout.renderBounds, layout.boxBounds, renderSpread);
|
|
6108
6149
|
}
|
|
6109
6150
|
};
|
|
6110
6151
|
|
|
@@ -6116,7 +6157,7 @@ const LeafRender = {
|
|
|
6116
6157
|
const data = this.__;
|
|
6117
6158
|
if (data.bright && !options.topRendering) return options.topList.add(this);
|
|
6118
6159
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
6119
|
-
canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
|
|
6160
|
+
canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
|
|
6120
6161
|
if (this.__.__single) {
|
|
6121
6162
|
if (data.eraser === "path") return this.__renderEraser(canvas, options);
|
|
6122
6163
|
const tempCanvas = canvas.getSameCanvas(true, true);
|
|
@@ -6170,7 +6211,7 @@ const BranchRender = {
|
|
|
6170
6211
|
if (data.eraser === "path") return this.__renderEraser(canvas, options);
|
|
6171
6212
|
const tempCanvas = canvas.getSameCanvas(false, true);
|
|
6172
6213
|
this.__renderBranch(tempCanvas, options);
|
|
6173
|
-
canvas.opacity = options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
|
|
6214
|
+
canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
|
|
6174
6215
|
canvas.copyWorldByReset(tempCanvas, nowWorld, nowWorld, data.__blendMode, true);
|
|
6175
6216
|
tempCanvas.recycle(nowWorld);
|
|
6176
6217
|
} else {
|
|
@@ -6186,7 +6227,7 @@ const BranchRender = {
|
|
|
6186
6227
|
const {children: children} = this;
|
|
6187
6228
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
6188
6229
|
child = children[i];
|
|
6189
|
-
excludeRenderBounds$1(child, options) || (child.
|
|
6230
|
+
excludeRenderBounds$1(child, options) || (child.__hasComplex ? LeafHelper.renderComplex(child, canvas, options) : child.__render(canvas, options));
|
|
6190
6231
|
}
|
|
6191
6232
|
}
|
|
6192
6233
|
},
|
|
@@ -6200,11 +6241,9 @@ const BranchRender = {
|
|
|
6200
6241
|
}
|
|
6201
6242
|
};
|
|
6202
6243
|
|
|
6203
|
-
const tempScaleData$1 = {};
|
|
6204
|
-
|
|
6205
6244
|
const {LEAF: LEAF, create: create} = IncrementId;
|
|
6206
6245
|
|
|
6207
|
-
const {stintSet: stintSet$
|
|
6246
|
+
const {stintSet: stintSet$6} = DataHelper;
|
|
6208
6247
|
|
|
6209
6248
|
const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint, multiplyParent: multiplyParent$1} = MatrixHelper;
|
|
6210
6249
|
|
|
@@ -6212,6 +6251,8 @@ const {toOuterOf: toOuterOf$1} = BoundsHelper;
|
|
|
6212
6251
|
|
|
6213
6252
|
const {copy: copy$5, move: move$8} = PointHelper;
|
|
6214
6253
|
|
|
6254
|
+
const {getScaleFixedData: getScaleFixedData$1} = MathHelper;
|
|
6255
|
+
|
|
6215
6256
|
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;
|
|
6216
6257
|
|
|
6217
6258
|
let Leaf = class Leaf {
|
|
@@ -6370,6 +6411,7 @@ let Leaf = class Leaf {
|
|
|
6370
6411
|
this.__level = this.parent ? this.parent.__level + 1 : 1;
|
|
6371
6412
|
if (this.animation) this.__runAnimation("in");
|
|
6372
6413
|
if (this.__bubbleMap) this.__emitLifeEvent(ChildEvent.MOUNTED);
|
|
6414
|
+
if (leafer.cacheId) LeafHelper.cacheId(this);
|
|
6373
6415
|
} else {
|
|
6374
6416
|
this.__emitLifeEvent(ChildEvent.UNMOUNTED);
|
|
6375
6417
|
}
|
|
@@ -6487,8 +6529,8 @@ let Leaf = class Leaf {
|
|
|
6487
6529
|
const cameraWorld = this.__cameraWorld, world = this.__world;
|
|
6488
6530
|
multiplyParent$1(world, options.matrix, cameraWorld, undefined, world);
|
|
6489
6531
|
toOuterOf$1(this.__layout.renderBounds, cameraWorld, cameraWorld);
|
|
6490
|
-
stintSet$
|
|
6491
|
-
stintSet$
|
|
6532
|
+
stintSet$6(cameraWorld, "half", world.half);
|
|
6533
|
+
stintSet$6(cameraWorld, "ignorePixelSnap", world.ignorePixelSnap);
|
|
6492
6534
|
return cameraWorld;
|
|
6493
6535
|
} else {
|
|
6494
6536
|
return this.__world;
|
|
@@ -6499,13 +6541,8 @@ let Leaf = class Leaf {
|
|
|
6499
6541
|
if (scaleX < 0) scaleX = -scaleX;
|
|
6500
6542
|
return scaleX > 1 ? scaleX : 1;
|
|
6501
6543
|
}
|
|
6502
|
-
getRenderScaleData(abs, scaleFixed) {
|
|
6503
|
-
|
|
6504
|
-
if (abs) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
|
|
6505
|
-
if (scaleFixed === true || scaleFixed === "zoom-in" && scaleX > 1 && scaleY > 1) scaleX = scaleY = 1;
|
|
6506
|
-
tempScaleData$1.scaleX = scaleX;
|
|
6507
|
-
tempScaleData$1.scaleY = scaleY;
|
|
6508
|
-
return tempScaleData$1;
|
|
6544
|
+
getRenderScaleData(abs, scaleFixed, unscale = true) {
|
|
6545
|
+
return getScaleFixedData$1(ImageManager.patternLocked ? this.__world : this.__nowWorld || this.__world, scaleFixed, unscale, abs);
|
|
6509
6546
|
}
|
|
6510
6547
|
getTransform(relative) {
|
|
6511
6548
|
return this.__layout.getTransform(relative || "local");
|
|
@@ -6544,14 +6581,16 @@ let Leaf = class Leaf {
|
|
|
6544
6581
|
relative.innerToWorld(world, to, distance);
|
|
6545
6582
|
world = to ? to : world;
|
|
6546
6583
|
}
|
|
6547
|
-
toInnerPoint(this.
|
|
6584
|
+
toInnerPoint(this.worldTransform, world, to, distance);
|
|
6548
6585
|
}
|
|
6549
6586
|
innerToWorld(inner, to, distance, relative) {
|
|
6550
|
-
toOuterPoint(this.
|
|
6587
|
+
toOuterPoint(this.worldTransform, inner, to, distance);
|
|
6551
6588
|
if (relative) relative.worldToInner(to ? to : inner, null, distance);
|
|
6552
6589
|
}
|
|
6553
6590
|
getBoxPoint(world, relative, distance, change) {
|
|
6554
|
-
|
|
6591
|
+
const inner = this.getInnerPoint(world, relative, distance, change);
|
|
6592
|
+
if (distance) return inner;
|
|
6593
|
+
return this.getBoxPointByInner(inner, null, null, true);
|
|
6555
6594
|
}
|
|
6556
6595
|
getBoxPointByInner(inner, _relative, _distance, change) {
|
|
6557
6596
|
const point = change ? inner : Object.assign({}, inner), {x: x, y: y} = this.boxBounds;
|
|
@@ -6667,7 +6706,6 @@ let Leaf = class Leaf {
|
|
|
6667
6706
|
__drawHitPath(_canvas) {}
|
|
6668
6707
|
__updateHitCanvas() {}
|
|
6669
6708
|
__render(_canvas, _options) {}
|
|
6670
|
-
__renderComplex(_canvas, _options) {}
|
|
6671
6709
|
__drawFast(_canvas, _options) {}
|
|
6672
6710
|
__draw(_canvas, _options, _originCanvas) {}
|
|
6673
6711
|
__clip(_canvas, _options) {}
|
|
@@ -6678,7 +6716,7 @@ let Leaf = class Leaf {
|
|
|
6678
6716
|
__drawPath(_canvas) {}
|
|
6679
6717
|
__drawRenderPath(_canvas) {}
|
|
6680
6718
|
__updatePath() {}
|
|
6681
|
-
__updateRenderPath() {}
|
|
6719
|
+
__updateRenderPath(_updateCache) {}
|
|
6682
6720
|
getMotionPathData() {
|
|
6683
6721
|
return Plugin.need("path");
|
|
6684
6722
|
}
|
|
@@ -6752,9 +6790,11 @@ let Branch = class Branch extends Leaf {
|
|
|
6752
6790
|
return 0;
|
|
6753
6791
|
}
|
|
6754
6792
|
__updateRenderSpread() {
|
|
6793
|
+
let layout;
|
|
6755
6794
|
const {children: children} = this;
|
|
6756
6795
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
6757
|
-
|
|
6796
|
+
layout = children[i].__layout;
|
|
6797
|
+
if (layout.renderSpread || layout.localOuterBounds) return 1;
|
|
6758
6798
|
}
|
|
6759
6799
|
return 0;
|
|
6760
6800
|
}
|
|
@@ -7013,7 +7053,7 @@ class LeafLevelList {
|
|
|
7013
7053
|
}
|
|
7014
7054
|
}
|
|
7015
7055
|
|
|
7016
|
-
const version = "2.0.
|
|
7056
|
+
const version = "2.0.4";
|
|
7017
7057
|
|
|
7018
7058
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7019
7059
|
get allowBackgroundColor() {
|
|
@@ -7852,7 +7892,7 @@ class Selector {
|
|
|
7852
7892
|
this.config = {};
|
|
7853
7893
|
if (userConfig) this.config = DataHelper.default(userConfig, this.config);
|
|
7854
7894
|
this.picker = new Picker(this.target = target, this);
|
|
7855
|
-
this.finder = Creator.finder && Creator.finder();
|
|
7895
|
+
this.finder = Creator.finder && Creator.finder(target, this.config);
|
|
7856
7896
|
}
|
|
7857
7897
|
getByPoint(hitPoint, hitRadius, options) {
|
|
7858
7898
|
const {target: target, picker: picker} = this;
|
|
@@ -7894,7 +7934,9 @@ function effectType(defaultValue) {
|
|
|
7894
7934
|
set(value) {
|
|
7895
7935
|
this.__setAttr(key, value);
|
|
7896
7936
|
if (value) this.__.__useEffect = true;
|
|
7897
|
-
|
|
7937
|
+
const layout = this.__layout;
|
|
7938
|
+
layout.renderChanged || layout.renderChange();
|
|
7939
|
+
layout.surfaceChange();
|
|
7898
7940
|
}
|
|
7899
7941
|
}));
|
|
7900
7942
|
}
|
|
@@ -7997,7 +8039,7 @@ const Transition = {
|
|
|
7997
8039
|
|
|
7998
8040
|
const {parse: parse, objectToCanvasData: objectToCanvasData} = PathConvert;
|
|
7999
8041
|
|
|
8000
|
-
const {stintSet: stintSet$
|
|
8042
|
+
const {stintSet: stintSet$5} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
|
|
8001
8043
|
|
|
8002
8044
|
const emptyPaint = {
|
|
8003
8045
|
originPaint: {}
|
|
@@ -8066,7 +8108,7 @@ class UIData extends LeafData {
|
|
|
8066
8108
|
setFill(value) {
|
|
8067
8109
|
if (this.__naturalWidth) this.__removeNaturalSize();
|
|
8068
8110
|
if (isString(value) || !value) {
|
|
8069
|
-
stintSet$
|
|
8111
|
+
stintSet$5(this, "__isTransparentFill", hasTransparent$2(value));
|
|
8070
8112
|
this.__isFills && this.__removePaint("fill", true);
|
|
8071
8113
|
this._fill = value;
|
|
8072
8114
|
} else if (isObject(value)) {
|
|
@@ -8075,7 +8117,7 @@ class UIData extends LeafData {
|
|
|
8075
8117
|
}
|
|
8076
8118
|
setStroke(value) {
|
|
8077
8119
|
if (isString(value) || !value) {
|
|
8078
|
-
stintSet$
|
|
8120
|
+
stintSet$5(this, "__isTransparentStroke", hasTransparent$2(value));
|
|
8079
8121
|
this.__isStrokes && this.__removePaint("stroke", true);
|
|
8080
8122
|
this._stroke = value;
|
|
8081
8123
|
} else if (isObject(value)) {
|
|
@@ -8108,15 +8150,16 @@ class UIData extends LeafData {
|
|
|
8108
8150
|
this.__needComputePaint = undefined;
|
|
8109
8151
|
}
|
|
8110
8152
|
__getRealStrokeWidth(childStyle) {
|
|
8111
|
-
let {strokeWidth: strokeWidth,
|
|
8153
|
+
let {strokeWidth: strokeWidth, strokeScaleFixed: strokeScaleFixed} = this;
|
|
8112
8154
|
if (childStyle) {
|
|
8113
8155
|
if (childStyle.strokeWidth) strokeWidth = childStyle.strokeWidth;
|
|
8114
|
-
if (!isUndefined(childStyle.
|
|
8156
|
+
if (!isUndefined(childStyle.strokeScaleFixed)) strokeScaleFixed = childStyle.strokeScaleFixed;
|
|
8115
8157
|
}
|
|
8116
|
-
if (
|
|
8117
|
-
const
|
|
8118
|
-
|
|
8119
|
-
}
|
|
8158
|
+
if (strokeScaleFixed) {
|
|
8159
|
+
const {scaleX: scaleX} = this.__leaf.getRenderScaleData(true, strokeScaleFixed, false);
|
|
8160
|
+
if (scaleX !== 1) return strokeWidth * scaleX;
|
|
8161
|
+
}
|
|
8162
|
+
return strokeWidth;
|
|
8120
8163
|
}
|
|
8121
8164
|
__setPaint(attrName, value) {
|
|
8122
8165
|
this.__setInput(attrName, value);
|
|
@@ -8133,11 +8176,11 @@ class UIData extends LeafData {
|
|
|
8133
8176
|
if (removeInput) this.__removeInput(attrName);
|
|
8134
8177
|
PaintImage.recycleImage(attrName, this);
|
|
8135
8178
|
if (attrName === "fill") {
|
|
8136
|
-
stintSet$
|
|
8179
|
+
stintSet$5(this, "__isAlphaPixelFill", undefined);
|
|
8137
8180
|
this._fill = this.__isFills = undefined;
|
|
8138
8181
|
} else {
|
|
8139
|
-
stintSet$
|
|
8140
|
-
stintSet$
|
|
8182
|
+
stintSet$5(this, "__isAlphaPixelStroke", undefined);
|
|
8183
|
+
stintSet$5(this, "__hasMultiStrokeStyle", undefined);
|
|
8141
8184
|
this._stroke = this.__isStrokes = undefined;
|
|
8142
8185
|
}
|
|
8143
8186
|
}
|
|
@@ -8198,7 +8241,11 @@ class EllipseData extends UIData {
|
|
|
8198
8241
|
|
|
8199
8242
|
class PolygonData extends LineData {}
|
|
8200
8243
|
|
|
8201
|
-
class StarData extends UIData {
|
|
8244
|
+
class StarData extends UIData {
|
|
8245
|
+
get __boxStroke() {
|
|
8246
|
+
return !this.__pathInputed;
|
|
8247
|
+
}
|
|
8248
|
+
}
|
|
8202
8249
|
|
|
8203
8250
|
class PathData extends UIData {
|
|
8204
8251
|
get __pathInputed() {
|
|
@@ -8302,7 +8349,7 @@ const UIBounds = {
|
|
|
8302
8349
|
const data = this.__, {strokeAlign: strokeAlign, __maxStrokeWidth: strokeWidth} = data, box = this.__box;
|
|
8303
8350
|
if ((data.stroke || data.hitStroke === "all") && strokeWidth && strokeAlign !== "inside") {
|
|
8304
8351
|
boxSpread = spread = strokeAlign === "center" ? strokeWidth / 2 : strokeWidth;
|
|
8305
|
-
if (!data.__boxStroke) {
|
|
8352
|
+
if (!data.__boxStroke || data.__useArrow) {
|
|
8306
8353
|
const miterLimitAddWidth = data.__isLinePath ? 0 : 10 * spread;
|
|
8307
8354
|
const storkeCapAddWidth = data.strokeCap === "none" ? 0 : strokeWidth;
|
|
8308
8355
|
spread += Math.max(miterLimitAddWidth, storkeCapAddWidth);
|
|
@@ -8332,23 +8379,23 @@ const UIBounds = {
|
|
|
8332
8379
|
}
|
|
8333
8380
|
};
|
|
8334
8381
|
|
|
8335
|
-
const {stintSet: stintSet$
|
|
8382
|
+
const {stintSet: stintSet$4} = DataHelper;
|
|
8336
8383
|
|
|
8337
8384
|
const UIRender = {
|
|
8338
8385
|
__updateChange() {
|
|
8339
8386
|
const data = this.__;
|
|
8340
8387
|
if (data.__useStroke) {
|
|
8341
8388
|
const useStroke = data.__useStroke = !!(data.stroke && data.strokeWidth);
|
|
8342
|
-
stintSet$
|
|
8343
|
-
stintSet$
|
|
8389
|
+
stintSet$4(this.__world, "half", useStroke && data.strokeAlign === "center" && data.strokeWidth % 2);
|
|
8390
|
+
stintSet$4(data, "__fillAfterStroke", useStroke && data.strokeAlign === "outside" && data.fill && !data.__isTransparentFill);
|
|
8344
8391
|
}
|
|
8345
8392
|
if (data.__useEffect) {
|
|
8346
8393
|
const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
|
|
8347
|
-
stintSet$
|
|
8394
|
+
stintSet$4(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
|
|
8348
8395
|
data.__useEffect = !!(shadow || otherEffect);
|
|
8349
8396
|
}
|
|
8350
8397
|
data.__checkSingle();
|
|
8351
|
-
stintSet$
|
|
8398
|
+
stintSet$4(data, "__complex", data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect);
|
|
8352
8399
|
},
|
|
8353
8400
|
__drawFast(canvas, options) {
|
|
8354
8401
|
drawFast(this, canvas, options);
|
|
@@ -8459,6 +8506,12 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8459
8506
|
get isFrame() {
|
|
8460
8507
|
return false;
|
|
8461
8508
|
}
|
|
8509
|
+
set strokeWidthFixed(value) {
|
|
8510
|
+
this.strokeScaleFixed = value;
|
|
8511
|
+
}
|
|
8512
|
+
get strokeWidthFixed() {
|
|
8513
|
+
return this.strokeScaleFixed;
|
|
8514
|
+
}
|
|
8462
8515
|
set scale(value) {
|
|
8463
8516
|
MathHelper.assignScale(this, value);
|
|
8464
8517
|
}
|
|
@@ -8514,6 +8567,9 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8514
8567
|
getPathString(curve, pathForRender, floatLength) {
|
|
8515
8568
|
return PathConvert.stringify(this.getPath(curve, pathForRender), floatLength);
|
|
8516
8569
|
}
|
|
8570
|
+
asPath(curve, pathForRender) {
|
|
8571
|
+
this.path = this.getPath(curve, pathForRender);
|
|
8572
|
+
}
|
|
8517
8573
|
load() {
|
|
8518
8574
|
this.__.__computePaint();
|
|
8519
8575
|
}
|
|
@@ -8523,16 +8579,18 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8523
8579
|
data.lazy && !this.__inLazyBounds && !Export.running ? data.__needComputePaint = true : data.__computePaint();
|
|
8524
8580
|
}
|
|
8525
8581
|
}
|
|
8526
|
-
__updateRenderPath() {
|
|
8582
|
+
__updateRenderPath(updateCache) {
|
|
8527
8583
|
const data = this.__;
|
|
8528
8584
|
if (data.path) {
|
|
8529
8585
|
data.__pathForRender = data.cornerRadius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
|
|
8530
|
-
if (data.__useArrow) PathArrow.addArrows(this);
|
|
8586
|
+
if (data.__useArrow) PathArrow.addArrows(this, updateCache);
|
|
8531
8587
|
} else data.__pathForRender && (data.__pathForRender = undefined);
|
|
8532
8588
|
}
|
|
8533
8589
|
__drawRenderPath(canvas) {
|
|
8590
|
+
const data = this.__;
|
|
8534
8591
|
canvas.beginPath();
|
|
8535
|
-
|
|
8592
|
+
if (data.__useArrow) PathArrow.updateArrow(this);
|
|
8593
|
+
this.__drawPathByData(canvas, data.__pathForRender);
|
|
8536
8594
|
}
|
|
8537
8595
|
__drawPath(canvas) {
|
|
8538
8596
|
canvas.beginPath();
|
|
@@ -8581,6 +8639,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8581
8639
|
static setEditOuter(_toolName) {}
|
|
8582
8640
|
static setEditInner(_editorName) {}
|
|
8583
8641
|
destroy() {
|
|
8642
|
+
this.__.__willDestroy = true;
|
|
8584
8643
|
this.fill = this.stroke = null;
|
|
8585
8644
|
if (this.__animate) this.killAnimate();
|
|
8586
8645
|
super.destroy();
|
|
@@ -8697,7 +8756,7 @@ __decorate([ strokeType("inside") ], UI.prototype, "strokeAlign", void 0);
|
|
|
8697
8756
|
|
|
8698
8757
|
__decorate([ strokeType(1, true) ], UI.prototype, "strokeWidth", void 0);
|
|
8699
8758
|
|
|
8700
|
-
__decorate([ strokeType(false) ], UI.prototype, "
|
|
8759
|
+
__decorate([ strokeType(false) ], UI.prototype, "strokeScaleFixed", void 0);
|
|
8701
8760
|
|
|
8702
8761
|
__decorate([ strokeType("none") ], UI.prototype, "strokeCap", void 0);
|
|
8703
8762
|
|
|
@@ -9198,6 +9257,9 @@ let Box = class Box extends Group {
|
|
|
9198
9257
|
get isBranchLeaf() {
|
|
9199
9258
|
return true;
|
|
9200
9259
|
}
|
|
9260
|
+
get __useSelfBox() {
|
|
9261
|
+
return this.pathInputed;
|
|
9262
|
+
}
|
|
9201
9263
|
constructor(data) {
|
|
9202
9264
|
super(data);
|
|
9203
9265
|
this.__layout.renderChanged || this.__layout.renderChange();
|
|
@@ -9213,7 +9275,7 @@ let Box = class Box extends Group {
|
|
|
9213
9275
|
}
|
|
9214
9276
|
__updateRectBoxBounds() {}
|
|
9215
9277
|
__updateBoxBounds(_secondLayout) {
|
|
9216
|
-
if (this.children.length && !this.
|
|
9278
|
+
if (this.children.length && !this.__useSelfBox) {
|
|
9217
9279
|
const data = this.__;
|
|
9218
9280
|
if (data.__autoSide) {
|
|
9219
9281
|
if (data.__hasSurface) this.__extraUpdate();
|
|
@@ -9322,38 +9384,38 @@ __decorate([ affectRenderBoundsType("hide") ], Frame.prototype, "overflow", void
|
|
|
9322
9384
|
|
|
9323
9385
|
Frame = __decorate([ registerUI() ], Frame);
|
|
9324
9386
|
|
|
9325
|
-
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
|
|
9387
|
+
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse$2} = PathCommandDataHelper;
|
|
9326
9388
|
|
|
9327
9389
|
let Ellipse = class Ellipse extends UI {
|
|
9328
9390
|
get __tag() {
|
|
9329
9391
|
return "Ellipse";
|
|
9330
9392
|
}
|
|
9331
9393
|
__updatePath() {
|
|
9332
|
-
const {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} =
|
|
9394
|
+
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = data;
|
|
9333
9395
|
const rx = width / 2, ry = height / 2;
|
|
9334
|
-
const path =
|
|
9396
|
+
const path = data.path = [];
|
|
9335
9397
|
let open;
|
|
9336
9398
|
if (innerRadius) {
|
|
9337
9399
|
if (startAngle || endAngle) {
|
|
9338
|
-
if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
|
|
9339
|
-
ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
9400
|
+
if (innerRadius < 1) ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
|
|
9401
|
+
ellipse$2(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
9340
9402
|
} else {
|
|
9341
9403
|
if (innerRadius < 1) {
|
|
9342
|
-
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
9404
|
+
ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
9343
9405
|
moveTo$3(path, width, ry);
|
|
9344
9406
|
}
|
|
9345
|
-
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9407
|
+
ellipse$2(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9346
9408
|
}
|
|
9347
9409
|
} else {
|
|
9348
9410
|
if (startAngle || endAngle) {
|
|
9349
9411
|
moveTo$3(path, rx, ry);
|
|
9350
|
-
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
9412
|
+
ellipse$2(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
9351
9413
|
} else {
|
|
9352
|
-
ellipse(path, rx, ry, rx, ry);
|
|
9414
|
+
ellipse$2(path, rx, ry, rx, ry);
|
|
9353
9415
|
}
|
|
9354
9416
|
}
|
|
9355
9417
|
if (!open) closePath$2(path);
|
|
9356
|
-
if (Platform.ellipseToCurve)
|
|
9418
|
+
if (Platform.ellipseToCurve || data.__useArrow) data.path = this.getPath(true);
|
|
9357
9419
|
}
|
|
9358
9420
|
};
|
|
9359
9421
|
|
|
@@ -9577,7 +9639,7 @@ __decorate([ resizeType() ], Canvas.prototype, "contextSettings", void 0);
|
|
|
9577
9639
|
|
|
9578
9640
|
Canvas = __decorate([ registerUI() ], Canvas);
|
|
9579
9641
|
|
|
9580
|
-
const {copyAndSpread: copyAndSpread$
|
|
9642
|
+
const {copyAndSpread: copyAndSpread$3, includes: includes, spread: spread, setList: setList} = BoundsHelper, {stintSet: stintSet$3} = DataHelper;
|
|
9581
9643
|
|
|
9582
9644
|
let Text = class Text extends UI {
|
|
9583
9645
|
get __tag() {
|
|
@@ -9594,9 +9656,9 @@ let Text = class Text extends UI {
|
|
|
9594
9656
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
9595
9657
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
|
|
9596
9658
|
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
|
|
9597
|
-
stintSet$
|
|
9598
|
-
stintSet$
|
|
9599
|
-
stintSet$
|
|
9659
|
+
stintSet$3(data, "__padding", padding && MathHelper.fourNumber(padding));
|
|
9660
|
+
stintSet$3(data, "__clipText", textOverflow !== "show" && !data.__autoSize);
|
|
9661
|
+
stintSet$3(data, "__isCharMode", width || height || data.__letterSpacing || textCase !== "none");
|
|
9600
9662
|
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
|
|
9601
9663
|
}
|
|
9602
9664
|
__updateBoxBounds() {
|
|
@@ -9631,7 +9693,7 @@ let Text = class Text extends UI {
|
|
|
9631
9693
|
}
|
|
9632
9694
|
__updateRenderBounds() {
|
|
9633
9695
|
const {renderBounds: renderBounds, renderSpread: renderSpread} = this.__layout;
|
|
9634
|
-
copyAndSpread$
|
|
9696
|
+
copyAndSpread$3(renderBounds, this.__.__textBoxBounds, renderSpread);
|
|
9635
9697
|
if (this.__box) this.__box.__layout.renderBounds = renderBounds;
|
|
9636
9698
|
}
|
|
9637
9699
|
__updateChange() {
|
|
@@ -9893,7 +9955,7 @@ let App = class App extends Leafer {
|
|
|
9893
9955
|
if (this.viewReady) this.renderer.update();
|
|
9894
9956
|
}
|
|
9895
9957
|
__render(canvas, options) {
|
|
9896
|
-
if (canvas.context) this.forEach(leafer => options.matrix ? leafer.__render(canvas, options) : canvas.copyWorld(leafer.canvas, options.bounds));
|
|
9958
|
+
if (canvas.context) this.forEach(leafer => options.matrix ? leafer.__render(canvas, options) : canvas.copyWorld(leafer.canvas, options.bounds, undefined, undefined, true));
|
|
9897
9959
|
}
|
|
9898
9960
|
__onResize(event) {
|
|
9899
9961
|
this.forEach(leafer => leafer.resize(event));
|
|
@@ -10945,6 +11007,14 @@ class InteractionBase {
|
|
|
10945
11007
|
stopDragAnimate() {
|
|
10946
11008
|
this.dragger.stopAnimate();
|
|
10947
11009
|
}
|
|
11010
|
+
replaceDownTarget(target) {
|
|
11011
|
+
const {downData: downData} = this;
|
|
11012
|
+
if (downData && target) {
|
|
11013
|
+
const {path: path} = downData;
|
|
11014
|
+
path.remove(path.list[0]);
|
|
11015
|
+
path.addAt(target, 0);
|
|
11016
|
+
}
|
|
11017
|
+
}
|
|
10948
11018
|
updateDownData(data, options, merge) {
|
|
10949
11019
|
const {downData: downData} = this;
|
|
10950
11020
|
if (!data && downData) data = downData;
|
|
@@ -11336,8 +11406,8 @@ function fills(fills, ui, canvas, renderOptions) {
|
|
|
11336
11406
|
canvas.save();
|
|
11337
11407
|
if (item.transform) canvas.transform(item.transform);
|
|
11338
11408
|
if (originPaint.scaleFixed) {
|
|
11339
|
-
const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
11340
|
-
if (
|
|
11409
|
+
const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, originPaint.scaleFixed, false);
|
|
11410
|
+
if (scaleX !== 1) canvas.scale(scaleX, scaleY);
|
|
11341
11411
|
}
|
|
11342
11412
|
if (originPaint.blendMode) canvas.blendMode = originPaint.blendMode;
|
|
11343
11413
|
fillPathOrText(ui, canvas, renderOptions);
|
|
@@ -11508,7 +11578,7 @@ function drawStrokesStyle(strokes, strokeWidthScale, isText, ui, canvas, renderO
|
|
|
11508
11578
|
}
|
|
11509
11579
|
}
|
|
11510
11580
|
|
|
11511
|
-
const {getSpread: getSpread, copyAndSpread: copyAndSpread$
|
|
11581
|
+
const {getSpread: getSpread, copyAndSpread: copyAndSpread$2, toOuterOf: toOuterOf, getOuterOf: getOuterOf, getByMove: getByMove, move: move$7, getIntersectData: getIntersectData} = BoundsHelper;
|
|
11512
11582
|
|
|
11513
11583
|
const tempBounds$2 = {};
|
|
11514
11584
|
|
|
@@ -11516,7 +11586,7 @@ function shape(ui, current, options) {
|
|
|
11516
11586
|
const canvas = current.getSameCanvas();
|
|
11517
11587
|
const currentBounds = current.bounds, nowWorld = ui.__nowWorld, layout = ui.__layout;
|
|
11518
11588
|
const nowWorldShapeBounds = ui.__nowWorldShapeBounds || (ui.__nowWorldShapeBounds = {});
|
|
11519
|
-
toOuterOf(layout.strokeSpread ? (copyAndSpread$
|
|
11589
|
+
toOuterOf(layout.strokeSpread ? (copyAndSpread$2(tempBounds$2, layout.boxBounds, layout.strokeSpread),
|
|
11520
11590
|
tempBounds$2) : layout.boxBounds, nowWorld, nowWorldShapeBounds);
|
|
11521
11591
|
let bounds, renderBounds, matrix, fitMatrix, shapeBounds, worldCanvas;
|
|
11522
11592
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
@@ -11572,7 +11642,7 @@ function shape(ui, current, options) {
|
|
|
11572
11642
|
|
|
11573
11643
|
let recycleMap;
|
|
11574
11644
|
|
|
11575
|
-
const {stintSet: stintSet} = DataHelper, {hasTransparent: hasTransparent$1} = ColorConvert;
|
|
11645
|
+
const {stintSet: stintSet$2} = DataHelper, {hasTransparent: hasTransparent$1} = ColorConvert;
|
|
11576
11646
|
|
|
11577
11647
|
function compute(attrName, ui) {
|
|
11578
11648
|
const data = ui.__, leafPaints = [];
|
|
@@ -11596,12 +11666,12 @@ function compute(attrName, ui) {
|
|
|
11596
11666
|
isTransparent = true;
|
|
11597
11667
|
}
|
|
11598
11668
|
if (attrName === "fill") {
|
|
11599
|
-
stintSet(data, "__isAlphaPixelFill", isAlphaPixel);
|
|
11600
|
-
stintSet(data, "__isTransparentFill", isTransparent);
|
|
11669
|
+
stintSet$2(data, "__isAlphaPixelFill", isAlphaPixel);
|
|
11670
|
+
stintSet$2(data, "__isTransparentFill", isTransparent);
|
|
11601
11671
|
} else {
|
|
11602
|
-
stintSet(data, "__isAlphaPixelStroke", isAlphaPixel);
|
|
11603
|
-
stintSet(data, "__isTransparentStroke", isTransparent);
|
|
11604
|
-
stintSet(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
11672
|
+
stintSet$2(data, "__isAlphaPixelStroke", isAlphaPixel);
|
|
11673
|
+
stintSet$2(data, "__isTransparentStroke", isTransparent);
|
|
11674
|
+
stintSet$2(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
11605
11675
|
}
|
|
11606
11676
|
} else {
|
|
11607
11677
|
data.__removePaint(attrName, false);
|
|
@@ -11674,12 +11744,12 @@ const PaintModule = {
|
|
|
11674
11744
|
|
|
11675
11745
|
let cache$1, box$2 = new Bounds;
|
|
11676
11746
|
|
|
11677
|
-
const {isSame: isSame} = BoundsHelper;
|
|
11747
|
+
const {isSame: isSame$1} = BoundsHelper;
|
|
11678
11748
|
|
|
11679
11749
|
function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
11680
11750
|
let leafPaint, event;
|
|
11681
11751
|
const image = ImageManager.get(paint, paint.type);
|
|
11682
|
-
if (cache$1 && paint === cache$1.paint && isSame(boxBounds, cache$1.boxBounds)) {
|
|
11752
|
+
if (cache$1 && paint === cache$1.paint && isSame$1(boxBounds, cache$1.boxBounds)) {
|
|
11683
11753
|
leafPaint = cache$1.leafPaint;
|
|
11684
11754
|
} else {
|
|
11685
11755
|
leafPaint = {
|
|
@@ -11758,6 +11828,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
11758
11828
|
const clip = transform && !transform.onlyScale || data.path || data.cornerRadius;
|
|
11759
11829
|
if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
|
|
11760
11830
|
}
|
|
11831
|
+
if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
|
|
11761
11832
|
return true;
|
|
11762
11833
|
}
|
|
11763
11834
|
|
|
@@ -11965,7 +12036,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
|
|
|
11965
12036
|
translate(transform, box.x + x, box.y + y);
|
|
11966
12037
|
}
|
|
11967
12038
|
|
|
11968
|
-
const {get: get$1, scale: scale$
|
|
12039
|
+
const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
|
|
11969
12040
|
|
|
11970
12041
|
const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$6} = Math;
|
|
11971
12042
|
|
|
@@ -11985,7 +12056,7 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
11985
12056
|
let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
|
|
11986
12057
|
if (paint.patternId !== id && !ui.destroyed) {
|
|
11987
12058
|
if (!(Platform.image.isLarge(paint.image, scaleX, scaleY) && !paint.data.repeat)) {
|
|
11988
|
-
const {image: image, data: data} = paint, {opacity: opacity
|
|
12059
|
+
const {image: image, data: data} = paint, {opacity: opacity} = paint.originPaint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
|
|
11989
12060
|
let imageMatrix, xGap, yGap, {width: width, height: height} = image;
|
|
11990
12061
|
if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
|
|
11991
12062
|
width *= scaleX;
|
|
@@ -11999,9 +12070,9 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
11999
12070
|
scaleY *= getFloorScale(height + (yGap || 0));
|
|
12000
12071
|
imageMatrix = get$1();
|
|
12001
12072
|
if (transform) copy$4(imageMatrix, transform);
|
|
12002
|
-
scale$
|
|
12073
|
+
scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
12003
12074
|
}
|
|
12004
|
-
const imageCanvas = image.getCanvas(width, height, opacity,
|
|
12075
|
+
const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
|
|
12005
12076
|
const pattern = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
|
|
12006
12077
|
paint.style = pattern;
|
|
12007
12078
|
paint.patternId = id;
|
|
@@ -12030,7 +12101,7 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
|
|
|
12030
12101
|
if (drawImage) {
|
|
12031
12102
|
if (data.repeat) {
|
|
12032
12103
|
drawImage = false;
|
|
12033
|
-
} else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp"
|
|
12104
|
+
} else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" || exporting)) {
|
|
12034
12105
|
drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
|
|
12035
12106
|
}
|
|
12036
12107
|
}
|
|
@@ -12092,6 +12163,7 @@ function recycleImage(attrName, data) {
|
|
|
12092
12163
|
if (!recycleMap) recycleMap = {};
|
|
12093
12164
|
recycleMap[url] = true;
|
|
12094
12165
|
ImageManager.recyclePaint(paint);
|
|
12166
|
+
if (data.__willDestroy && image.parent) PaintImage.recycleFilter(image, data.__leaf);
|
|
12095
12167
|
if (image.loading) {
|
|
12096
12168
|
if (!input) {
|
|
12097
12169
|
input = data.__input && data.__input[attrName] || [];
|
|
@@ -12582,7 +12654,7 @@ function createRows(drawData, content, style) {
|
|
|
12582
12654
|
}, row = {
|
|
12583
12655
|
words: []
|
|
12584
12656
|
};
|
|
12585
|
-
|
|
12657
|
+
content = [ ...content ];
|
|
12586
12658
|
for (let i = 0, len = content.length; i < len; i++) {
|
|
12587
12659
|
char = content[i];
|
|
12588
12660
|
if (char === "\n") {
|
|
@@ -13055,8 +13127,11 @@ function targetAttr(fn) {
|
|
|
13055
13127
|
});
|
|
13056
13128
|
if (isObject(check)) value = check; else if (check === false) return;
|
|
13057
13129
|
}
|
|
13058
|
-
t.
|
|
13059
|
-
|
|
13130
|
+
if (t.hasDimOthers) {
|
|
13131
|
+
t.setDimOthers(false);
|
|
13132
|
+
t.setBright(false);
|
|
13133
|
+
t.hasDimOthers = undefined;
|
|
13134
|
+
}
|
|
13060
13135
|
if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
|
|
13061
13136
|
if (t.single) {
|
|
13062
13137
|
delete t.element.syncEventer;
|
|
@@ -13081,7 +13156,8 @@ function mergeConfigAttr() {
|
|
|
13081
13156
|
return (target, key) => {
|
|
13082
13157
|
defineKey(target, key, {
|
|
13083
13158
|
get() {
|
|
13084
|
-
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, app: app} = this, mergeConfig = Object.assign({}, config);
|
|
13159
|
+
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, editTool: editTool, innerEditor: innerEditor, app: app} = this, mergeConfig = Object.assign({}, config);
|
|
13160
|
+
if (innerEditor) innerEditor.editConfig && Object.assign(mergeConfig, innerEditor.editConfig); else if (editTool) editTool.editConfig && Object.assign(mergeConfig, editTool.editConfig);
|
|
13085
13161
|
if (element && element.editConfig) {
|
|
13086
13162
|
let {editConfig: editConfig} = element;
|
|
13087
13163
|
if (editConfig.hover || editConfig.hoverStyle) {
|
|
@@ -13984,8 +14060,11 @@ class EditBox extends Group {
|
|
|
13984
14060
|
const {editMask: editMask} = editor;
|
|
13985
14061
|
const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
|
|
13986
14062
|
editMask.visible = mask ? true : 0;
|
|
13987
|
-
|
|
13988
|
-
|
|
14063
|
+
if (!isUndefined(dimOthers) || !isUndefined(bright)) {
|
|
14064
|
+
editor.setDimOthers(dimOthers);
|
|
14065
|
+
editor.setBright(!!dimOthers || bright);
|
|
14066
|
+
editor.hasDimOthers = true;
|
|
14067
|
+
}
|
|
13989
14068
|
if (spread) BoundsHelper.spread(bounds, spread);
|
|
13990
14069
|
if (this.view.worldOpacity) {
|
|
13991
14070
|
const {width: width, height: height} = bounds;
|
|
@@ -14004,7 +14083,8 @@ class EditBox extends Group {
|
|
|
14004
14083
|
resizeL = resizeLines[(i - 1) / 2];
|
|
14005
14084
|
resizeL.set(point);
|
|
14006
14085
|
resizeL.visible = resizeP.visible && !hideResizeLines;
|
|
14007
|
-
resizeP.visible
|
|
14086
|
+
if (resizeP.visible) resizeP.visible = !!middlePoint;
|
|
14087
|
+
if (rotateP.visible) rotateP.visible = !!middlePoint;
|
|
14008
14088
|
if ((i + 1) / 2 % 2) {
|
|
14009
14089
|
resizeL.width = width + resizeL.height;
|
|
14010
14090
|
if (hideOnSmall && resizeP.width * 2 > width) resizeP.visible = false;
|
|
@@ -14090,8 +14170,9 @@ class EditBox extends Group {
|
|
|
14090
14170
|
onDragStart(e) {
|
|
14091
14171
|
this.dragging = true;
|
|
14092
14172
|
const point = this.dragPoint = e.current, {pointType: pointType} = point;
|
|
14093
|
-
const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = this.mergeConfig;
|
|
14173
|
+
const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, onCopy: onCopy} = this.mergeConfig;
|
|
14094
14174
|
if (pointType === "move") {
|
|
14175
|
+
if (e.altKey && onCopy && onCopy() && this.editor.single) this.app.interaction.replaceDownTarget(this.target);
|
|
14095
14176
|
moveable && (this.moving = true);
|
|
14096
14177
|
} else {
|
|
14097
14178
|
if (pointType.includes("rotate") || this.isHoldRotateKey(e) || !resizeable) {
|
|
@@ -14210,26 +14291,31 @@ class EditBox extends Group {
|
|
|
14210
14291
|
updatePointCursor(this, e);
|
|
14211
14292
|
}
|
|
14212
14293
|
onArrow(e) {
|
|
14213
|
-
if (this.canUse
|
|
14294
|
+
if (this.canUse) {
|
|
14214
14295
|
let x = 0, y = 0;
|
|
14215
|
-
const distance = e.shiftKey ? 10 : 1;
|
|
14216
14296
|
switch (e.code) {
|
|
14217
14297
|
case "ArrowDown":
|
|
14218
|
-
y =
|
|
14298
|
+
y = 1;
|
|
14219
14299
|
break;
|
|
14220
14300
|
|
|
14221
14301
|
case "ArrowUp":
|
|
14222
|
-
y = -
|
|
14302
|
+
y = -1;
|
|
14223
14303
|
break;
|
|
14224
14304
|
|
|
14225
14305
|
case "ArrowLeft":
|
|
14226
|
-
x = -
|
|
14306
|
+
x = -1;
|
|
14227
14307
|
break;
|
|
14228
14308
|
|
|
14229
14309
|
case "ArrowRight":
|
|
14230
|
-
x =
|
|
14310
|
+
x = 1;
|
|
14311
|
+
}
|
|
14312
|
+
if (x || y) {
|
|
14313
|
+
const {keyEvent: keyEvent, arrowStep: arrowStep, arrowFastStep: arrowFastStep} = this.mergeConfig;
|
|
14314
|
+
if (keyEvent) {
|
|
14315
|
+
const step = e.shiftKey ? arrowFastStep : arrowStep;
|
|
14316
|
+
this.transformTool.move(x * step, y * step);
|
|
14317
|
+
}
|
|
14231
14318
|
}
|
|
14232
|
-
if (x || y) this.transformTool.move(x, y);
|
|
14233
14319
|
}
|
|
14234
14320
|
}
|
|
14235
14321
|
onDoubleTap(e) {
|
|
@@ -14341,6 +14427,8 @@ const config$1 = {
|
|
|
14341
14427
|
pointSize: 10,
|
|
14342
14428
|
pointRadius: 16,
|
|
14343
14429
|
rotateGap: 45,
|
|
14430
|
+
arrowStep: 1,
|
|
14431
|
+
arrowFastStep: 10,
|
|
14344
14432
|
buttonsDirection: "bottom",
|
|
14345
14433
|
buttonsMargin: 12,
|
|
14346
14434
|
hideOnSmall: true,
|
|
@@ -16958,7 +17046,7 @@ Arrow = __decorate([ registerUI() ], Arrow);
|
|
|
16958
17046
|
|
|
16959
17047
|
const {M: M$2, L: L$2, C: C$2, Q: Q$1, O: O$1} = PathCommandMap;
|
|
16960
17048
|
|
|
16961
|
-
const {rotate: rotate$1, copyFrom: copyFrom$1, scale: scale} = PointHelper;
|
|
17049
|
+
const {rotate: rotate$1, copyFrom: copyFrom$1, scale: scale$1} = PointHelper;
|
|
16962
17050
|
|
|
16963
17051
|
const point$1 = {};
|
|
16964
17052
|
|
|
@@ -17005,7 +17093,7 @@ const PathMatrixHelper = {
|
|
|
17005
17093
|
function setPoint$2(data, startIndex, x, y, scaleX, scaleY, rotation, origin) {
|
|
17006
17094
|
copyFrom$1(point$1, data[startIndex], data[startIndex + 1]);
|
|
17007
17095
|
if (rotation) rotate$1(point$1, rotation, origin);
|
|
17008
|
-
if (scaleX) scale(point$1, scaleX, scaleY);
|
|
17096
|
+
if (scaleX) scale$1(point$1, scaleX, scaleY);
|
|
17009
17097
|
data[startIndex] = x + point$1.x;
|
|
17010
17098
|
data[startIndex + 1] = y + point$1.y;
|
|
17011
17099
|
}
|
|
@@ -17014,12 +17102,14 @@ const {layout: layout$2, rotate: rotate} = PathMatrixHelper;
|
|
|
17014
17102
|
|
|
17015
17103
|
const {getAngle: getAngle} = PointHelper;
|
|
17016
17104
|
|
|
17017
|
-
const
|
|
17105
|
+
const zero = {
|
|
17106
|
+
x: 0
|
|
17107
|
+
}, half = {
|
|
17018
17108
|
x: -.5
|
|
17019
17109
|
};
|
|
17020
17110
|
|
|
17021
17111
|
const angle = {
|
|
17022
|
-
connect:
|
|
17112
|
+
connect: zero,
|
|
17023
17113
|
offset: {
|
|
17024
17114
|
x: -.71,
|
|
17025
17115
|
bevelJoin: .36,
|
|
@@ -17040,73 +17130,110 @@ const angleSide = {
|
|
|
17040
17130
|
|
|
17041
17131
|
const triangleLinePath = [ 1, -3, 0, 2, -3, -2, 2, 0, 0, 2, -3, 2, 2, -3, 0 ];
|
|
17042
17132
|
|
|
17043
|
-
const
|
|
17044
|
-
connect:
|
|
17133
|
+
const triangleFill = {
|
|
17134
|
+
connect: zero,
|
|
17045
17135
|
offset: {
|
|
17046
17136
|
x: -.9,
|
|
17047
17137
|
bevelJoin: .624,
|
|
17048
17138
|
roundJoin: .4
|
|
17049
17139
|
},
|
|
17050
|
-
path: [ ...triangleLinePath
|
|
17051
|
-
dashPath: [ 1, -2, 0, 2, -.5, 0 ]
|
|
17140
|
+
path: [ ...triangleLinePath ]
|
|
17052
17141
|
};
|
|
17053
17142
|
|
|
17054
|
-
const
|
|
17143
|
+
const triangle = DataHelper.clone(triangleFill);
|
|
17055
17144
|
|
|
17056
|
-
|
|
17057
|
-
|
|
17058
|
-
|
|
17059
|
-
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
path: [ ...
|
|
17064
|
-
dashPath: [ 1, -3, 0, 2, -.5, 0 ]
|
|
17145
|
+
triangle.path = [ ...triangleLinePath, 1, -2.05, 1.1, 2, -2.05, -1.1 ];
|
|
17146
|
+
|
|
17147
|
+
triangle.dashPath = [ 1, -2, 0, 2, -.5, 0 ];
|
|
17148
|
+
|
|
17149
|
+
const triangleFlipFill = {
|
|
17150
|
+
connect: zero,
|
|
17151
|
+
offset: half,
|
|
17152
|
+
path: [ ...triangleFill.path ]
|
|
17065
17153
|
};
|
|
17066
17154
|
|
|
17067
17155
|
const triangleFlip = {
|
|
17156
|
+
connect: zero,
|
|
17068
17157
|
offset: half,
|
|
17069
17158
|
path: [ ...triangle.path ],
|
|
17070
17159
|
dashPath: [ 1, -2.5, 0, 2, -1, 0 ]
|
|
17071
17160
|
};
|
|
17072
17161
|
|
|
17162
|
+
rotate(triangleFlipFill.path, 180, {
|
|
17163
|
+
x: -1.5,
|
|
17164
|
+
y: 0
|
|
17165
|
+
});
|
|
17166
|
+
|
|
17073
17167
|
rotate(triangleFlip.path, 180, {
|
|
17074
17168
|
x: -1.5,
|
|
17075
17169
|
y: 0
|
|
17076
17170
|
});
|
|
17077
17171
|
|
|
17172
|
+
const arrowLinePath = [ 1, -3, 0, 2, -3.5, -1.8, 2, 0, 0, 2, -3.5, 1.8, 2, -3, 0 ];
|
|
17173
|
+
|
|
17174
|
+
const arrowFill = {
|
|
17175
|
+
connect: zero,
|
|
17176
|
+
offset: {
|
|
17177
|
+
x: -1.1,
|
|
17178
|
+
bevelJoin: .872,
|
|
17179
|
+
roundJoin: .6
|
|
17180
|
+
},
|
|
17181
|
+
path: [ ...arrowLinePath ]
|
|
17182
|
+
};
|
|
17183
|
+
|
|
17184
|
+
const arrow = DataHelper.clone(arrowFill);
|
|
17185
|
+
|
|
17186
|
+
arrow.path = [ ...arrowLinePath, 1, -2.25, .95, 2, -2.25, -.95 ];
|
|
17187
|
+
|
|
17188
|
+
arrow.dashPath = [ 1, -3, 0, 2, -.5, 0 ];
|
|
17189
|
+
|
|
17078
17190
|
const circleLine = {
|
|
17079
17191
|
connect: {
|
|
17080
|
-
x: -1.
|
|
17192
|
+
x: -1.8
|
|
17081
17193
|
},
|
|
17082
17194
|
path: [ 1, 1.8, -.1, 2, 1.8, 0, 26, 0, 0, 1.8, 0, 359, 0 ]
|
|
17083
17195
|
};
|
|
17084
17196
|
|
|
17085
|
-
const
|
|
17197
|
+
const circleFill = {
|
|
17086
17198
|
connect: {
|
|
17087
17199
|
x: .5
|
|
17088
17200
|
},
|
|
17089
|
-
path: [ ...circleLine.path
|
|
17090
|
-
dashPath: [ 1, -.5, 0, 2, .5, 0 ]
|
|
17201
|
+
path: [ ...circleLine.path ]
|
|
17091
17202
|
};
|
|
17092
17203
|
|
|
17204
|
+
const circle = DataHelper.clone(circleFill);
|
|
17205
|
+
|
|
17206
|
+
circle.path = [ ...circleLine.path, 1, 0, 0, 26, 0, 0, 1, 0, 360, 0 ];
|
|
17207
|
+
|
|
17208
|
+
circle.dashPath = [ 1, -.5, 0, 2, .5, 0 ];
|
|
17209
|
+
|
|
17093
17210
|
const squareLine = {
|
|
17094
17211
|
connect: {
|
|
17095
|
-
x: -1.
|
|
17212
|
+
x: -1.4
|
|
17096
17213
|
},
|
|
17097
17214
|
path: [ 1, -1.4, 0, 2, -1.4, -1.4, 2, 1.4, -1.4, 2, 1.4, 1.4, 2, -1.4, 1.4, 2, -1.4, 0 ]
|
|
17098
17215
|
};
|
|
17099
17216
|
|
|
17217
|
+
const squareFill = {
|
|
17218
|
+
path: [ ...squareLine.path ]
|
|
17219
|
+
};
|
|
17220
|
+
|
|
17100
17221
|
const square = {
|
|
17101
17222
|
path: [ ...squareLine.path, 2, -1.4, -.49, 2, 1, -.49, 1, -1.4, .49, 2, 1, .49 ]
|
|
17102
17223
|
};
|
|
17103
17224
|
|
|
17104
17225
|
const diamondLine = DataHelper.clone(squareLine);
|
|
17105
17226
|
|
|
17227
|
+
diamondLine.connect.x = -1.9;
|
|
17228
|
+
|
|
17229
|
+
const diamondFill = DataHelper.clone(squareFill);
|
|
17230
|
+
|
|
17106
17231
|
const diamond = DataHelper.clone(square);
|
|
17107
17232
|
|
|
17108
17233
|
rotate(diamondLine.path, 45);
|
|
17109
17234
|
|
|
17235
|
+
rotate(diamondFill.path, 45);
|
|
17236
|
+
|
|
17110
17237
|
rotate(diamond.path, 45);
|
|
17111
17238
|
|
|
17112
17239
|
const mark = {
|
|
@@ -17129,19 +17256,34 @@ const arrows = {
|
|
|
17129
17256
|
mark: mark
|
|
17130
17257
|
};
|
|
17131
17258
|
|
|
17259
|
+
const fillArrows = {
|
|
17260
|
+
triangle: triangleFill,
|
|
17261
|
+
"triangle-flip": triangleFlipFill,
|
|
17262
|
+
arrow: arrowFill,
|
|
17263
|
+
circle: circleFill,
|
|
17264
|
+
square: squareFill,
|
|
17265
|
+
diamond: diamondFill
|
|
17266
|
+
};
|
|
17267
|
+
|
|
17132
17268
|
function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern) {
|
|
17133
|
-
let pathData, scale;
|
|
17269
|
+
let pathData, scale = 1, rotation = 0, fill;
|
|
17134
17270
|
const {strokeCap: strokeCap, strokeJoin: strokeJoin} = ui.__;
|
|
17135
17271
|
if (isObject(arrow)) {
|
|
17136
17272
|
if (arrow.type) {
|
|
17137
|
-
scale = arrow.scale;
|
|
17273
|
+
scale = arrow.scale || 1;
|
|
17274
|
+
rotation = arrow.rotation || 0;
|
|
17138
17275
|
pathData = arrows[arrow.type];
|
|
17276
|
+
if (scale > 1) {
|
|
17277
|
+
const fillData = fillArrows[arrow.type];
|
|
17278
|
+
if (fillData) pathData = fillData, fill = true;
|
|
17279
|
+
}
|
|
17139
17280
|
} else pathData = arrow;
|
|
17140
17281
|
} else {
|
|
17141
17282
|
pathData = arrows[arrow];
|
|
17142
17283
|
}
|
|
17284
|
+
if (!fill) fill = pathData.fill;
|
|
17143
17285
|
const {offset: offset, connect: connect, path: path, dashPath: dashPath} = pathData;
|
|
17144
|
-
let connectX = connect ? connect.x : 0;
|
|
17286
|
+
let connectX = connect ? connect.x * scale : 0;
|
|
17145
17287
|
let offsetX = offset ? offset.x : 0;
|
|
17146
17288
|
const data = [ ...path ];
|
|
17147
17289
|
if (hasDashPattern && dashPath) data.push(...dashPath);
|
|
@@ -17149,28 +17291,38 @@ function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern)
|
|
|
17149
17291
|
if (offset) {
|
|
17150
17292
|
if (strokeJoin === "round" && offset.roundJoin) offsetX += offset.roundJoin; else if (strokeJoin === "bevel" && offset.bevelJoin) offsetX += offset.bevelJoin;
|
|
17151
17293
|
}
|
|
17152
|
-
if (scale) layout$2(data, 0, 0, scale, scale);
|
|
17294
|
+
if (scale !== 1) layout$2(data, 0, 0, scale, scale);
|
|
17153
17295
|
if (offsetX) layout$2(data, offsetX, 0);
|
|
17154
|
-
layout$2(data, to.x, to.y, size, size, getAngle(from, to));
|
|
17296
|
+
layout$2(data, to.x, to.y, size, size, getAngle(from, to) + rotation);
|
|
17155
17297
|
connectOffset.x = (connectX + offsetX) * size;
|
|
17156
|
-
|
|
17298
|
+
const arrowData = {
|
|
17299
|
+
data: data
|
|
17300
|
+
};
|
|
17301
|
+
if (fill) arrowData.fill = fill;
|
|
17302
|
+
return arrowData;
|
|
17157
17303
|
}
|
|
17158
17304
|
|
|
17159
17305
|
const {M: M$1, L: L$1, C: C$1, Q: Q, Z: Z$1, N: N, D: D, X: X, G: G, F: F, O: O, P: P, U: U} = PathCommandMap;
|
|
17160
17306
|
|
|
17161
|
-
const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint} = PointHelper;
|
|
17307
|
+
const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint, isSame: isSame} = PointHelper;
|
|
17308
|
+
|
|
17309
|
+
const {stintSet: stintSet$1} = DataHelper;
|
|
17162
17310
|
|
|
17163
17311
|
const connectPoint = {};
|
|
17164
17312
|
|
|
17165
17313
|
const first = {}, second = {};
|
|
17166
17314
|
|
|
17167
|
-
const last = {}, now = {};
|
|
17315
|
+
const old = {}, last = {}, now = {};
|
|
17168
17316
|
|
|
17169
17317
|
const PathArrowModule = {
|
|
17170
17318
|
list: arrows,
|
|
17171
|
-
|
|
17172
|
-
|
|
17319
|
+
fillList: fillArrows,
|
|
17320
|
+
addArrows(ui, updateCache) {
|
|
17321
|
+
const uData = ui.__;
|
|
17322
|
+
const {startArrow: startArrow, endArrow: endArrow, __strokeWidth: strokeWidth, dashPattern: dashPattern, __pathForRender: data, cornerRadius: cornerRadius} = uData;
|
|
17173
17323
|
const clonePathForArrow = !cornerRadius;
|
|
17324
|
+
if (!updateCache) uData.__strokeWidthCache = strokeWidth;
|
|
17325
|
+
let startArrowPath, singleStartArrow, endArrowPath, singleEndArrow;
|
|
17174
17326
|
let command, i = 0, len = data.length, count = 0, useStartArrow = startArrow && startArrow !== "none";
|
|
17175
17327
|
while (i < len) {
|
|
17176
17328
|
command = data[i];
|
|
@@ -17178,6 +17330,7 @@ const PathArrowModule = {
|
|
|
17178
17330
|
case M$1:
|
|
17179
17331
|
case L$1:
|
|
17180
17332
|
if (count < 2 || i + 6 >= len) {
|
|
17333
|
+
copy(old, now);
|
|
17181
17334
|
copyFrom(now, data[i + 1], data[i + 2]);
|
|
17182
17335
|
if (!count && useStartArrow) copy(first, now);
|
|
17183
17336
|
}
|
|
@@ -17185,12 +17338,18 @@ const PathArrowModule = {
|
|
|
17185
17338
|
break;
|
|
17186
17339
|
|
|
17187
17340
|
case C$1:
|
|
17188
|
-
if (count === 1 || i + 7 >= len - 3)
|
|
17341
|
+
if (count === 1 || i + 7 >= len - 3) {
|
|
17342
|
+
copyPoints(data, last, now, i + 3);
|
|
17343
|
+
old.x = data[i + 1], old.y = data[i + 2];
|
|
17344
|
+
}
|
|
17189
17345
|
i += 7;
|
|
17190
17346
|
break;
|
|
17191
17347
|
|
|
17192
17348
|
case Q:
|
|
17193
|
-
if (count === 1 || i + 5 >= len - 3)
|
|
17349
|
+
if (count === 1 || i + 5 >= len - 3) {
|
|
17350
|
+
copyPoints(data, last, now, i + 1);
|
|
17351
|
+
copy(old, last);
|
|
17352
|
+
}
|
|
17194
17353
|
i += 5;
|
|
17195
17354
|
break;
|
|
17196
17355
|
|
|
@@ -17228,6 +17387,7 @@ const PathArrowModule = {
|
|
|
17228
17387
|
case U:
|
|
17229
17388
|
if (count === 1 || i + 6 >= len - 3) {
|
|
17230
17389
|
copyPoints(data, last, now, i + 1);
|
|
17390
|
+
copy(old, last);
|
|
17231
17391
|
if (i + 6 !== len) {
|
|
17232
17392
|
now.x -= (now.x - last.x) / 10;
|
|
17233
17393
|
now.y -= (now.y - last.y) / 10;
|
|
@@ -17238,13 +17398,13 @@ const PathArrowModule = {
|
|
|
17238
17398
|
}
|
|
17239
17399
|
count++;
|
|
17240
17400
|
if (count === 1 && command !== M$1) return;
|
|
17241
|
-
if (count === 2 && useStartArrow) copy(second, command === L$1 ? now : last);
|
|
17401
|
+
if (count === 2 && useStartArrow) copy(second, command === L$1 ? now : isSame(old, first) ? last : old);
|
|
17242
17402
|
if (i === len) {
|
|
17243
|
-
const path =
|
|
17244
|
-
const pathForArrow = ui.__.__pathForArrow = [];
|
|
17403
|
+
const path = uData.__pathForRender = clonePathForArrow ? [ ...data ] : data;
|
|
17245
17404
|
if (useStartArrow) {
|
|
17246
|
-
|
|
17247
|
-
|
|
17405
|
+
startArrowPath = getArrowPath(ui, startArrow, second, first, strokeWidth, connectPoint, !!dashPattern);
|
|
17406
|
+
singleStartArrow = startArrowPath.fill || dashPattern;
|
|
17407
|
+
if (!singleStartArrow) path.push(...startArrowPath.data);
|
|
17248
17408
|
if (connectPoint.x) {
|
|
17249
17409
|
getDistancePoint(first, second, -connectPoint.x, true);
|
|
17250
17410
|
path[1] = second.x;
|
|
@@ -17252,8 +17412,10 @@ const PathArrowModule = {
|
|
|
17252
17412
|
}
|
|
17253
17413
|
}
|
|
17254
17414
|
if (endArrow && endArrow !== "none") {
|
|
17255
|
-
|
|
17256
|
-
|
|
17415
|
+
if (isSame(last, now)) copy(last, old);
|
|
17416
|
+
endArrowPath = getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint, !!dashPattern);
|
|
17417
|
+
singleEndArrow = endArrowPath.fill || dashPattern;
|
|
17418
|
+
if (!singleEndArrow) path.push(...endArrowPath.data);
|
|
17257
17419
|
if (connectPoint.x) {
|
|
17258
17420
|
getDistancePoint(now, last, -connectPoint.x, true);
|
|
17259
17421
|
let index;
|
|
@@ -17280,10 +17442,21 @@ const PathArrowModule = {
|
|
|
17280
17442
|
} else {
|
|
17281
17443
|
copy(last, now);
|
|
17282
17444
|
}
|
|
17445
|
+
stintSet$1(uData, "__startArrowPath", singleStartArrow && startArrowPath);
|
|
17446
|
+
stintSet$1(uData, "__endArrowPath", singleEndArrow && endArrowPath);
|
|
17283
17447
|
}
|
|
17284
17448
|
},
|
|
17285
|
-
|
|
17449
|
+
updateArrow(ui) {
|
|
17450
|
+
const data = ui.__;
|
|
17451
|
+
if (data.strokeScaleFixed) {
|
|
17452
|
+
if (data.__strokeWidthCache !== data.__strokeWidth) {
|
|
17453
|
+
ui.__updateRenderPath(true);
|
|
17454
|
+
}
|
|
17455
|
+
}
|
|
17456
|
+
},
|
|
17457
|
+
register(name, data, fillData) {
|
|
17286
17458
|
this.list[name] = data;
|
|
17459
|
+
if (fillData) this.fillList[name] = data;
|
|
17287
17460
|
},
|
|
17288
17461
|
get(name) {
|
|
17289
17462
|
return this.list[name];
|
|
@@ -17309,12 +17482,26 @@ UI.addAttr("endArrow", "none", arrowType);
|
|
|
17309
17482
|
Object.assign(PathArrow, PathArrowModule);
|
|
17310
17483
|
|
|
17311
17484
|
Object.assign(Paint, {
|
|
17312
|
-
strokeArrow(
|
|
17313
|
-
|
|
17485
|
+
strokeArrow(stroke, ui, canvas, _renderOptions) {
|
|
17486
|
+
const {__startArrowPath: __startArrowPath, __endArrowPath: __endArrowPath, dashPattern: dashPattern} = ui.__;
|
|
17487
|
+
if (dashPattern) canvas.dashPattern = null;
|
|
17488
|
+
if (__startArrowPath) {
|
|
17489
|
+
canvas.beginPath();
|
|
17490
|
+
ui.__drawPathByData(canvas, __startArrowPath.data);
|
|
17491
|
+
canvas.stroke();
|
|
17492
|
+
if (__startArrowPath.fill) {
|
|
17493
|
+
canvas.fillStyle = stroke;
|
|
17494
|
+
canvas.fill();
|
|
17495
|
+
}
|
|
17496
|
+
}
|
|
17497
|
+
if (__endArrowPath) {
|
|
17314
17498
|
canvas.beginPath();
|
|
17315
|
-
ui.__drawPathByData(canvas,
|
|
17316
|
-
canvas.dashPattern = null;
|
|
17499
|
+
ui.__drawPathByData(canvas, __endArrowPath.data);
|
|
17317
17500
|
canvas.stroke();
|
|
17501
|
+
if (__endArrowPath.fill) {
|
|
17502
|
+
canvas.fillStyle = stroke;
|
|
17503
|
+
canvas.fill();
|
|
17504
|
+
}
|
|
17318
17505
|
}
|
|
17319
17506
|
}
|
|
17320
17507
|
});
|
|
@@ -17776,7 +17963,7 @@ UI.addAttr("autoHeight", undefined, autoBoundsType);
|
|
|
17776
17963
|
|
|
17777
17964
|
UI.addAttr("autoBox", undefined, boundsType);
|
|
17778
17965
|
|
|
17779
|
-
const {copyAndSpread: copyAndSpread} = BoundsHelper;
|
|
17966
|
+
const {copyAndSpread: copyAndSpread$1} = BoundsHelper;
|
|
17780
17967
|
|
|
17781
17968
|
box$1.__updateFlowLayout = function() {
|
|
17782
17969
|
const {leaferIsCreated: leaferIsCreated, flow: flow} = this;
|
|
@@ -17808,7 +17995,7 @@ box$1.__updateContentBounds = function() {
|
|
|
17808
17995
|
const same = layout.contentBounds === layout.boxBounds;
|
|
17809
17996
|
if (padding) {
|
|
17810
17997
|
if (same) layout.shrinkContent();
|
|
17811
|
-
copyAndSpread(layout.contentBounds, layout.boxBounds, padding, true);
|
|
17998
|
+
copyAndSpread$1(layout.contentBounds, layout.boxBounds, padding, true);
|
|
17812
17999
|
} else {
|
|
17813
18000
|
if (!same) layout.shrinkContentCancel();
|
|
17814
18001
|
}
|
|
@@ -17830,7 +18017,7 @@ box$1.__updateBoxBounds = function(secondLayout) {
|
|
|
17830
18017
|
boxBounds.width = data.width, boxBounds.x = 0;
|
|
17831
18018
|
}
|
|
17832
18019
|
}
|
|
17833
|
-
flow && secondLayout && data.padding && copyAndSpread(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : data.__autoWidth ? "width" : "height");
|
|
18020
|
+
flow && secondLayout && data.padding && copyAndSpread$1(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : data.__autoWidth ? "width" : "height");
|
|
17834
18021
|
this.__updateNaturalSize();
|
|
17835
18022
|
} else {
|
|
17836
18023
|
this.__updateRectBoxBounds();
|
|
@@ -19814,9 +20001,7 @@ const {Yes: Yes, NoAndSkip: NoAndSkip, YesAndSkip: YesAndSkip} = Answer;
|
|
|
19814
20001
|
const idCondition = {}, classNameCondition = {}, tagCondition = {};
|
|
19815
20002
|
|
|
19816
20003
|
class Finder {
|
|
19817
|
-
constructor(target) {
|
|
19818
|
-
this.innerIdMap = {};
|
|
19819
|
-
this.idMap = {};
|
|
20004
|
+
constructor(target, _config) {
|
|
19820
20005
|
this.methods = {
|
|
19821
20006
|
id: (leaf, name) => leaf.id === name ? (this.target && (this.idMap[name] = leaf),
|
|
19822
20007
|
1) : 0,
|
|
@@ -19826,6 +20011,13 @@ class Finder {
|
|
|
19826
20011
|
tag: (leaf, name) => leaf.__tag === name ? 1 : 0,
|
|
19827
20012
|
tags: (leaf, nameMap) => nameMap[leaf.__tag] ? 1 : 0
|
|
19828
20013
|
};
|
|
20014
|
+
this.idMap = {};
|
|
20015
|
+
this.innerIdMap = {};
|
|
20016
|
+
const app = target && target.app;
|
|
20017
|
+
if (app) {
|
|
20018
|
+
app.idMap ? this.idMap = app.idMap : app.idMap = this.idMap;
|
|
20019
|
+
app.innerIdMap ? this.innerIdMap = app.innerIdMap : app.innerIdMap = this.innerIdMap;
|
|
20020
|
+
}
|
|
19829
20021
|
if (this.target = target) this.__listenEvents();
|
|
19830
20022
|
}
|
|
19831
20023
|
getBy(condition, branch, one, options) {
|
|
@@ -19952,8 +20144,14 @@ ui.findOne = function(condition, options) {
|
|
|
19952
20144
|
|
|
19953
20145
|
Plugin.add("find");
|
|
19954
20146
|
|
|
19955
|
-
Creator.finder = function(target) {
|
|
19956
|
-
return new Finder(target);
|
|
20147
|
+
Creator.finder = function(target, config) {
|
|
20148
|
+
return new Finder(target, config);
|
|
20149
|
+
};
|
|
20150
|
+
|
|
20151
|
+
LeafHelper.cacheId = function(t) {
|
|
20152
|
+
const {leafer: leafer, id: id} = t;
|
|
20153
|
+
if (id) leafer.app.idMap[id] = t;
|
|
20154
|
+
if (leafer.cacheInnerId) leafer.app.innerIdMap[t.innerId] = t;
|
|
19957
20155
|
};
|
|
19958
20156
|
|
|
19959
20157
|
const {setPoint: setPoint, addPoint: addPoint, toBounds: toBounds} = TwoPointBoundsHelper;
|
|
@@ -20246,7 +20444,7 @@ const config = {
|
|
|
20246
20444
|
style: {
|
|
20247
20445
|
dragBoundsType: "outer",
|
|
20248
20446
|
strokeAlign: "center",
|
|
20249
|
-
|
|
20447
|
+
strokeScaleFixed: "zoom-in",
|
|
20250
20448
|
width: 6,
|
|
20251
20449
|
height: 6,
|
|
20252
20450
|
opacity: .5,
|
|
@@ -20495,4 +20693,185 @@ Scroller.registerTheme("dark", {
|
|
|
20495
20693
|
}
|
|
20496
20694
|
});
|
|
20497
20695
|
|
|
20498
|
-
|
|
20696
|
+
const {stintSet: stintSet} = DataHelper;
|
|
20697
|
+
|
|
20698
|
+
function scaleFixedType(defaultValue) {
|
|
20699
|
+
return decorateLeafAttr(defaultValue, key => attr({
|
|
20700
|
+
set(value) {
|
|
20701
|
+
if (this.__setAttr(key, value)) {
|
|
20702
|
+
const layout = this.__layout;
|
|
20703
|
+
doBoundsType(this);
|
|
20704
|
+
if (!isNumber(value)) value = value ? 1 : 0;
|
|
20705
|
+
stintSet(layout, "scaleFixed", value);
|
|
20706
|
+
stintSet(layout, "outerScale", value ? 1 / value : 0);
|
|
20707
|
+
if (!layout.outerScale && layout.localOuterBounds) layout.localOuterBounds = undefined;
|
|
20708
|
+
}
|
|
20709
|
+
}
|
|
20710
|
+
}));
|
|
20711
|
+
}
|
|
20712
|
+
|
|
20713
|
+
const {scale: scale} = MatrixHelper;
|
|
20714
|
+
|
|
20715
|
+
const {copyAndSpread: copyAndSpread} = BoundsHelper;
|
|
20716
|
+
|
|
20717
|
+
const {getScaleFixedData: getScaleFixedData} = MathHelper;
|
|
20718
|
+
|
|
20719
|
+
LeafHelper.updateScaleFixedWorld = function(t) {
|
|
20720
|
+
const {__world: __world, __: __} = t, {scaleX: scaleX, scaleY: scaleY} = getScaleFixedData(__world, __.scaleFixed);
|
|
20721
|
+
if (scaleX !== 1) {
|
|
20722
|
+
scale(__world, scaleX, scaleY);
|
|
20723
|
+
__world.scaleX *= scaleX, __world.scaleY *= scaleY;
|
|
20724
|
+
}
|
|
20725
|
+
};
|
|
20726
|
+
|
|
20727
|
+
LeafHelper.updateOuterBounds = function(t) {
|
|
20728
|
+
const layout = t.__layout, {localRenderBounds: localRenderBounds} = layout;
|
|
20729
|
+
const localOuterBounds = layout.localOuterBounds || (layout.localOuterBounds = {});
|
|
20730
|
+
const {width: width, height: height} = localRenderBounds;
|
|
20731
|
+
const scale = layout.outerScale - 1;
|
|
20732
|
+
copyAndSpread(localOuterBounds, localRenderBounds, [ height * scale, width * scale ]);
|
|
20733
|
+
if (t.parent) t.parent.__layout.renderChange();
|
|
20734
|
+
};
|
|
20735
|
+
|
|
20736
|
+
Plugin.add("scale-fixed");
|
|
20737
|
+
|
|
20738
|
+
UI.addAttr("scaleFixed", undefined, scaleFixedType);
|
|
20739
|
+
|
|
20740
|
+
class EllipseBoxData extends BoxData {}
|
|
20741
|
+
|
|
20742
|
+
const ellipse$1 = Ellipse.prototype;
|
|
20743
|
+
|
|
20744
|
+
let EllipseBox = class EllipseBox extends Box {
|
|
20745
|
+
get __tag() {
|
|
20746
|
+
return "EllipseBox";
|
|
20747
|
+
}
|
|
20748
|
+
__updatePath() {}
|
|
20749
|
+
};
|
|
20750
|
+
|
|
20751
|
+
__decorate([ dataProcessor(EllipseBoxData) ], EllipseBox.prototype, "__", void 0);
|
|
20752
|
+
|
|
20753
|
+
__decorate([ pathType(0) ], EllipseBox.prototype, "innerRadius", void 0);
|
|
20754
|
+
|
|
20755
|
+
__decorate([ pathType(0) ], EllipseBox.prototype, "startAngle", void 0);
|
|
20756
|
+
|
|
20757
|
+
__decorate([ pathType(0) ], EllipseBox.prototype, "endAngle", void 0);
|
|
20758
|
+
|
|
20759
|
+
__decorate([ rewrite(ellipse$1.__updatePath) ], EllipseBox.prototype, "__updatePath", null);
|
|
20760
|
+
|
|
20761
|
+
EllipseBox = __decorate([ rewriteAble(), registerUI() ], EllipseBox);
|
|
20762
|
+
|
|
20763
|
+
class PolygonBoxData extends BoxData {
|
|
20764
|
+
get __usePathBox() {
|
|
20765
|
+
return this.points || this.__pathInputed;
|
|
20766
|
+
}
|
|
20767
|
+
}
|
|
20768
|
+
|
|
20769
|
+
const polygon = Polygon.prototype;
|
|
20770
|
+
|
|
20771
|
+
let PolygonBox = class PolygonBox extends Box {
|
|
20772
|
+
get __tag() {
|
|
20773
|
+
return "PolygonBox";
|
|
20774
|
+
}
|
|
20775
|
+
__updatePath() {}
|
|
20776
|
+
};
|
|
20777
|
+
|
|
20778
|
+
__decorate([ dataProcessor(PolygonBoxData) ], PolygonBox.prototype, "__", void 0);
|
|
20779
|
+
|
|
20780
|
+
__decorate([ pathType(3) ], PolygonBox.prototype, "sides", void 0);
|
|
20781
|
+
|
|
20782
|
+
__decorate([ pathType() ], PolygonBox.prototype, "points", void 0);
|
|
20783
|
+
|
|
20784
|
+
__decorate([ pathType(0) ], PolygonBox.prototype, "curve", void 0);
|
|
20785
|
+
|
|
20786
|
+
__decorate([ rewrite(polygon.__updatePath) ], PolygonBox.prototype, "__updatePath", null);
|
|
20787
|
+
|
|
20788
|
+
PolygonBox = __decorate([ rewriteAble(), registerUI() ], PolygonBox);
|
|
20789
|
+
|
|
20790
|
+
class StarBoxData extends BoxData {}
|
|
20791
|
+
|
|
20792
|
+
const ellipse = Star.prototype;
|
|
20793
|
+
|
|
20794
|
+
let StarBox = class StarBox extends Box {
|
|
20795
|
+
get __tag() {
|
|
20796
|
+
return "StarBox";
|
|
20797
|
+
}
|
|
20798
|
+
__updatePath() {}
|
|
20799
|
+
};
|
|
20800
|
+
|
|
20801
|
+
__decorate([ pathType(5) ], StarBox.prototype, "corners", void 0);
|
|
20802
|
+
|
|
20803
|
+
__decorate([ pathType(.382) ], StarBox.prototype, "innerRadius", void 0);
|
|
20804
|
+
|
|
20805
|
+
__decorate([ dataProcessor(StarBoxData) ], StarBox.prototype, "__", void 0);
|
|
20806
|
+
|
|
20807
|
+
__decorate([ rewrite(ellipse.__updatePath) ], StarBox.prototype, "__updatePath", null);
|
|
20808
|
+
|
|
20809
|
+
StarBox = __decorate([ rewriteAble(), registerUI() ], StarBox);
|
|
20810
|
+
|
|
20811
|
+
class PathBoxData extends BoxData {}
|
|
20812
|
+
|
|
20813
|
+
let PathBox = class PathBox extends Box {
|
|
20814
|
+
get __tag() {
|
|
20815
|
+
return "PathBox";
|
|
20816
|
+
}
|
|
20817
|
+
};
|
|
20818
|
+
|
|
20819
|
+
__decorate([ dataProcessor(PathBoxData) ], PathBox.prototype, "__", void 0);
|
|
20820
|
+
|
|
20821
|
+
__decorate([ affectStrokeBoundsType("center") ], PathBox.prototype, "strokeAlign", void 0);
|
|
20822
|
+
|
|
20823
|
+
PathBox = __decorate([ registerUI() ], PathBox);
|
|
20824
|
+
|
|
20825
|
+
class ImageBoxData extends BoxData {
|
|
20826
|
+
get __urlType() {
|
|
20827
|
+
return "image";
|
|
20828
|
+
}
|
|
20829
|
+
setUrl(value) {
|
|
20830
|
+
this.__setImageFill(value);
|
|
20831
|
+
this._url = value;
|
|
20832
|
+
}
|
|
20833
|
+
__setImageFill(value) {
|
|
20834
|
+
this.fill = value ? {
|
|
20835
|
+
type: this.__urlType,
|
|
20836
|
+
mode: "stretch",
|
|
20837
|
+
url: value
|
|
20838
|
+
} : undefined;
|
|
20839
|
+
}
|
|
20840
|
+
__getData() {
|
|
20841
|
+
const data = super.__getData();
|
|
20842
|
+
if (data.url) delete data.fill;
|
|
20843
|
+
return data;
|
|
20844
|
+
}
|
|
20845
|
+
__getInputData(names, options) {
|
|
20846
|
+
const data = super.__getInputData(names, options);
|
|
20847
|
+
if (data.url) delete data.fill;
|
|
20848
|
+
return data;
|
|
20849
|
+
}
|
|
20850
|
+
}
|
|
20851
|
+
|
|
20852
|
+
let ImageBox = class ImageBox extends Box {
|
|
20853
|
+
get __tag() {
|
|
20854
|
+
return "ImageBox";
|
|
20855
|
+
}
|
|
20856
|
+
get ready() {
|
|
20857
|
+
const {image: image} = this;
|
|
20858
|
+
return image && image.ready;
|
|
20859
|
+
}
|
|
20860
|
+
get image() {
|
|
20861
|
+
const {fill: fill} = this.__;
|
|
20862
|
+
return isArray(fill) && fill[0].image;
|
|
20863
|
+
}
|
|
20864
|
+
get __useSelfBox() {
|
|
20865
|
+
return true;
|
|
20866
|
+
}
|
|
20867
|
+
};
|
|
20868
|
+
|
|
20869
|
+
__decorate([ dataProcessor(ImageBoxData) ], ImageBox.prototype, "__", void 0);
|
|
20870
|
+
|
|
20871
|
+
__decorate([ boundsType("") ], ImageBox.prototype, "url", void 0);
|
|
20872
|
+
|
|
20873
|
+
ImageBox = __decorate([ registerUI() ], ImageBox);
|
|
20874
|
+
|
|
20875
|
+
Plugin.add("box");
|
|
20876
|
+
|
|
20877
|
+
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|