@leafer/miniapp 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/miniapp.cjs +11 -0
- package/dist/miniapp.esm.js +2 -0
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +363 -147
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +23 -22
- package/src/index.ts +1 -0
package/dist/miniapp.module.js
CHANGED
|
@@ -213,6 +213,7 @@ class LeafData {
|
|
|
213
213
|
}
|
|
214
214
|
destroy() {
|
|
215
215
|
this.__input = this.__middle = null;
|
|
216
|
+
if (this.__complexData) this.__complexData.destroy();
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
|
@@ -311,6 +312,8 @@ const {set: set$2, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumbe
|
|
|
311
312
|
|
|
312
313
|
const {round: round$6, pow: pow$2, max: max$6, floor: floor$3, PI: PI$4} = Math;
|
|
313
314
|
|
|
315
|
+
const tempScaleData$1 = {};
|
|
316
|
+
|
|
314
317
|
const MathHelper = {
|
|
315
318
|
within(value, min, max) {
|
|
316
319
|
if (isObject(min)) max = min.max, min = min.min;
|
|
@@ -354,6 +357,24 @@ const MathHelper = {
|
|
|
354
357
|
} else if (scale) MathHelper.assignScale(scaleData, scale);
|
|
355
358
|
return scaleData;
|
|
356
359
|
},
|
|
360
|
+
getScaleFixedData(worldScaleData, scaleFixed, unscale, abs, _localScaleData) {
|
|
361
|
+
let {scaleX: scaleX, scaleY: scaleY} = worldScaleData;
|
|
362
|
+
if (abs || scaleFixed) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
|
|
363
|
+
if (scaleFixed) {
|
|
364
|
+
if (scaleFixed === true) {
|
|
365
|
+
scaleX = scaleY = unscale ? 1 : 1 / scaleX;
|
|
366
|
+
} else {
|
|
367
|
+
let minScale;
|
|
368
|
+
if (isNumber(scaleFixed)) minScale = scaleFixed; else if (scaleFixed === "zoom-in") minScale = 1;
|
|
369
|
+
if (minScale) {
|
|
370
|
+
if (scaleX > minScale || scaleY > minScale) scaleX = scaleY = unscale ? 1 : 1 / scaleX; else scaleX = scaleY = unscale ? 1 : 1 / minScale;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
tempScaleData$1.scaleX = scaleX;
|
|
375
|
+
tempScaleData$1.scaleY = scaleY;
|
|
376
|
+
return tempScaleData$1;
|
|
377
|
+
},
|
|
357
378
|
assignScale(scaleData, scale) {
|
|
358
379
|
if (isNumber(scale)) {
|
|
359
380
|
scaleData.scaleX = scaleData.scaleY = scale;
|
|
@@ -850,8 +871,8 @@ const PointHelper = {
|
|
|
850
871
|
if (isObject(originPoints[0])) points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
851
872
|
return points;
|
|
852
873
|
},
|
|
853
|
-
isSame(t, point) {
|
|
854
|
-
return float$5(t.x) === float$5(point.x) && float$5(t.y) === float$5(point.y);
|
|
874
|
+
isSame(t, point, quick) {
|
|
875
|
+
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);
|
|
855
876
|
},
|
|
856
877
|
reset(t) {
|
|
857
878
|
P$7.reset(t);
|
|
@@ -926,8 +947,8 @@ class Point {
|
|
|
926
947
|
getAtan2(to) {
|
|
927
948
|
return PointHelper.getAtan2(this, to);
|
|
928
949
|
}
|
|
929
|
-
isSame(point) {
|
|
930
|
-
return PointHelper.isSame(this, point);
|
|
950
|
+
isSame(point, quick) {
|
|
951
|
+
return PointHelper.isSame(this, point, quick);
|
|
931
952
|
}
|
|
932
953
|
reset() {
|
|
933
954
|
PointHelper.reset(this);
|
|
@@ -1183,9 +1204,9 @@ const AroundHelper = {
|
|
|
1183
1204
|
}
|
|
1184
1205
|
if (!onlyBoxSize) to.x += box.x, to.y += box.y;
|
|
1185
1206
|
},
|
|
1186
|
-
getPoint(around, box, to) {
|
|
1207
|
+
getPoint(around, box, to, onlyBoxSize = true) {
|
|
1187
1208
|
if (!to) to = {};
|
|
1188
|
-
AroundHelper.toPoint(around, box, to,
|
|
1209
|
+
AroundHelper.toPoint(around, box, to, onlyBoxSize);
|
|
1189
1210
|
return to;
|
|
1190
1211
|
}
|
|
1191
1212
|
};
|
|
@@ -1452,6 +1473,9 @@ const BoundsHelper = {
|
|
|
1452
1473
|
y: y + height
|
|
1453
1474
|
} ];
|
|
1454
1475
|
},
|
|
1476
|
+
getPoint(t, around, onlyBoxSize = false, to) {
|
|
1477
|
+
return AroundHelper.getPoint(around, t, to, onlyBoxSize);
|
|
1478
|
+
},
|
|
1455
1479
|
hitRadiusPoint(t, point, pointMatrix) {
|
|
1456
1480
|
if (pointMatrix) point = PointHelper.tempToInnerRadiusPointOf(point, pointMatrix);
|
|
1457
1481
|
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);
|
|
@@ -1623,6 +1647,9 @@ class Bounds {
|
|
|
1623
1647
|
getPoints() {
|
|
1624
1648
|
return BoundsHelper.getPoints(this);
|
|
1625
1649
|
}
|
|
1650
|
+
getPoint(around, onlyBoxSize, to) {
|
|
1651
|
+
return BoundsHelper.getPoint(this, around, onlyBoxSize, to);
|
|
1652
|
+
}
|
|
1626
1653
|
hitPoint(point, pointMatrix) {
|
|
1627
1654
|
return BoundsHelper.hitPoint(this, point, pointMatrix);
|
|
1628
1655
|
}
|
|
@@ -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) {
|
|
@@ -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");
|
|
@@ -6667,7 +6704,6 @@ let Leaf = class Leaf {
|
|
|
6667
6704
|
__drawHitPath(_canvas) {}
|
|
6668
6705
|
__updateHitCanvas() {}
|
|
6669
6706
|
__render(_canvas, _options) {}
|
|
6670
|
-
__renderComplex(_canvas, _options) {}
|
|
6671
6707
|
__drawFast(_canvas, _options) {}
|
|
6672
6708
|
__draw(_canvas, _options, _originCanvas) {}
|
|
6673
6709
|
__clip(_canvas, _options) {}
|
|
@@ -6678,7 +6714,7 @@ let Leaf = class Leaf {
|
|
|
6678
6714
|
__drawPath(_canvas) {}
|
|
6679
6715
|
__drawRenderPath(_canvas) {}
|
|
6680
6716
|
__updatePath() {}
|
|
6681
|
-
__updateRenderPath() {}
|
|
6717
|
+
__updateRenderPath(_updateCache) {}
|
|
6682
6718
|
getMotionPathData() {
|
|
6683
6719
|
return Plugin.need("path");
|
|
6684
6720
|
}
|
|
@@ -6752,9 +6788,11 @@ let Branch = class Branch extends Leaf {
|
|
|
6752
6788
|
return 0;
|
|
6753
6789
|
}
|
|
6754
6790
|
__updateRenderSpread() {
|
|
6791
|
+
let layout;
|
|
6755
6792
|
const {children: children} = this;
|
|
6756
6793
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
6757
|
-
|
|
6794
|
+
layout = children[i].__layout;
|
|
6795
|
+
if (layout.renderSpread || layout.localOuterBounds) return 1;
|
|
6758
6796
|
}
|
|
6759
6797
|
return 0;
|
|
6760
6798
|
}
|
|
@@ -7013,7 +7051,7 @@ class LeafLevelList {
|
|
|
7013
7051
|
}
|
|
7014
7052
|
}
|
|
7015
7053
|
|
|
7016
|
-
const version = "2.0.
|
|
7054
|
+
const version = "2.0.3";
|
|
7017
7055
|
|
|
7018
7056
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7019
7057
|
get allowBackgroundColor() {
|
|
@@ -8006,7 +8044,7 @@ class Selector {
|
|
|
8006
8044
|
this.config = {};
|
|
8007
8045
|
if (userConfig) this.config = DataHelper.default(userConfig, this.config);
|
|
8008
8046
|
this.picker = new Picker(this.target = target, this);
|
|
8009
|
-
this.finder = Creator.finder && Creator.finder();
|
|
8047
|
+
this.finder = Creator.finder && Creator.finder(target, this.config);
|
|
8010
8048
|
}
|
|
8011
8049
|
getByPoint(hitPoint, hitRadius, options) {
|
|
8012
8050
|
const {target: target, picker: picker} = this;
|
|
@@ -8048,7 +8086,9 @@ function effectType(defaultValue) {
|
|
|
8048
8086
|
set(value) {
|
|
8049
8087
|
this.__setAttr(key, value);
|
|
8050
8088
|
if (value) this.__.__useEffect = true;
|
|
8051
|
-
|
|
8089
|
+
const layout = this.__layout;
|
|
8090
|
+
layout.renderChanged || layout.renderChange();
|
|
8091
|
+
layout.surfaceChange();
|
|
8052
8092
|
}
|
|
8053
8093
|
}));
|
|
8054
8094
|
}
|
|
@@ -8151,7 +8191,7 @@ const Transition = {
|
|
|
8151
8191
|
|
|
8152
8192
|
const {parse: parse, objectToCanvasData: objectToCanvasData} = PathConvert;
|
|
8153
8193
|
|
|
8154
|
-
const {stintSet: stintSet$
|
|
8194
|
+
const {stintSet: stintSet$5} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
|
|
8155
8195
|
|
|
8156
8196
|
const emptyPaint = {
|
|
8157
8197
|
originPaint: {}
|
|
@@ -8220,7 +8260,7 @@ class UIData extends LeafData {
|
|
|
8220
8260
|
setFill(value) {
|
|
8221
8261
|
if (this.__naturalWidth) this.__removeNaturalSize();
|
|
8222
8262
|
if (isString(value) || !value) {
|
|
8223
|
-
stintSet$
|
|
8263
|
+
stintSet$5(this, "__isTransparentFill", hasTransparent$2(value));
|
|
8224
8264
|
this.__isFills && this.__removePaint("fill", true);
|
|
8225
8265
|
this._fill = value;
|
|
8226
8266
|
} else if (isObject(value)) {
|
|
@@ -8229,7 +8269,7 @@ class UIData extends LeafData {
|
|
|
8229
8269
|
}
|
|
8230
8270
|
setStroke(value) {
|
|
8231
8271
|
if (isString(value) || !value) {
|
|
8232
|
-
stintSet$
|
|
8272
|
+
stintSet$5(this, "__isTransparentStroke", hasTransparent$2(value));
|
|
8233
8273
|
this.__isStrokes && this.__removePaint("stroke", true);
|
|
8234
8274
|
this._stroke = value;
|
|
8235
8275
|
} else if (isObject(value)) {
|
|
@@ -8262,15 +8302,16 @@ class UIData extends LeafData {
|
|
|
8262
8302
|
this.__needComputePaint = undefined;
|
|
8263
8303
|
}
|
|
8264
8304
|
__getRealStrokeWidth(childStyle) {
|
|
8265
|
-
let {strokeWidth: strokeWidth,
|
|
8305
|
+
let {strokeWidth: strokeWidth, strokeScaleFixed: strokeScaleFixed} = this;
|
|
8266
8306
|
if (childStyle) {
|
|
8267
8307
|
if (childStyle.strokeWidth) strokeWidth = childStyle.strokeWidth;
|
|
8268
|
-
if (!isUndefined(childStyle.
|
|
8308
|
+
if (!isUndefined(childStyle.strokeScaleFixed)) strokeScaleFixed = childStyle.strokeScaleFixed;
|
|
8269
8309
|
}
|
|
8270
|
-
if (
|
|
8271
|
-
const
|
|
8272
|
-
|
|
8273
|
-
}
|
|
8310
|
+
if (strokeScaleFixed) {
|
|
8311
|
+
const {scaleX: scaleX} = this.__leaf.getRenderScaleData(true, strokeScaleFixed, false);
|
|
8312
|
+
if (scaleX !== 1) return strokeWidth * scaleX;
|
|
8313
|
+
}
|
|
8314
|
+
return strokeWidth;
|
|
8274
8315
|
}
|
|
8275
8316
|
__setPaint(attrName, value) {
|
|
8276
8317
|
this.__setInput(attrName, value);
|
|
@@ -8287,11 +8328,11 @@ class UIData extends LeafData {
|
|
|
8287
8328
|
if (removeInput) this.__removeInput(attrName);
|
|
8288
8329
|
PaintImage.recycleImage(attrName, this);
|
|
8289
8330
|
if (attrName === "fill") {
|
|
8290
|
-
stintSet$
|
|
8331
|
+
stintSet$5(this, "__isAlphaPixelFill", undefined);
|
|
8291
8332
|
this._fill = this.__isFills = undefined;
|
|
8292
8333
|
} else {
|
|
8293
|
-
stintSet$
|
|
8294
|
-
stintSet$
|
|
8334
|
+
stintSet$5(this, "__isAlphaPixelStroke", undefined);
|
|
8335
|
+
stintSet$5(this, "__hasMultiStrokeStyle", undefined);
|
|
8295
8336
|
this._stroke = this.__isStrokes = undefined;
|
|
8296
8337
|
}
|
|
8297
8338
|
}
|
|
@@ -8456,7 +8497,7 @@ const UIBounds = {
|
|
|
8456
8497
|
const data = this.__, {strokeAlign: strokeAlign, __maxStrokeWidth: strokeWidth} = data, box = this.__box;
|
|
8457
8498
|
if ((data.stroke || data.hitStroke === "all") && strokeWidth && strokeAlign !== "inside") {
|
|
8458
8499
|
boxSpread = spread = strokeAlign === "center" ? strokeWidth / 2 : strokeWidth;
|
|
8459
|
-
if (!data.__boxStroke) {
|
|
8500
|
+
if (!data.__boxStroke || data.__useArrow) {
|
|
8460
8501
|
const miterLimitAddWidth = data.__isLinePath ? 0 : 10 * spread;
|
|
8461
8502
|
const storkeCapAddWidth = data.strokeCap === "none" ? 0 : strokeWidth;
|
|
8462
8503
|
spread += Math.max(miterLimitAddWidth, storkeCapAddWidth);
|
|
@@ -8486,23 +8527,23 @@ const UIBounds = {
|
|
|
8486
8527
|
}
|
|
8487
8528
|
};
|
|
8488
8529
|
|
|
8489
|
-
const {stintSet: stintSet$
|
|
8530
|
+
const {stintSet: stintSet$4} = DataHelper;
|
|
8490
8531
|
|
|
8491
8532
|
const UIRender = {
|
|
8492
8533
|
__updateChange() {
|
|
8493
8534
|
const data = this.__;
|
|
8494
8535
|
if (data.__useStroke) {
|
|
8495
8536
|
const useStroke = data.__useStroke = !!(data.stroke && data.strokeWidth);
|
|
8496
|
-
stintSet$
|
|
8497
|
-
stintSet$
|
|
8537
|
+
stintSet$4(this.__world, "half", useStroke && data.strokeAlign === "center" && data.strokeWidth % 2);
|
|
8538
|
+
stintSet$4(data, "__fillAfterStroke", useStroke && data.strokeAlign === "outside" && data.fill && !data.__isTransparentFill);
|
|
8498
8539
|
}
|
|
8499
8540
|
if (data.__useEffect) {
|
|
8500
8541
|
const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
|
|
8501
|
-
stintSet$
|
|
8542
|
+
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"));
|
|
8502
8543
|
data.__useEffect = !!(shadow || otherEffect);
|
|
8503
8544
|
}
|
|
8504
8545
|
data.__checkSingle();
|
|
8505
|
-
stintSet$
|
|
8546
|
+
stintSet$4(data, "__complex", data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect);
|
|
8506
8547
|
},
|
|
8507
8548
|
__drawFast(canvas, options) {
|
|
8508
8549
|
drawFast(this, canvas, options);
|
|
@@ -8613,6 +8654,12 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8613
8654
|
get isFrame() {
|
|
8614
8655
|
return false;
|
|
8615
8656
|
}
|
|
8657
|
+
set strokeWidthFixed(value) {
|
|
8658
|
+
this.strokeScaleFixed = value;
|
|
8659
|
+
}
|
|
8660
|
+
get strokeWidthFixed() {
|
|
8661
|
+
return this.strokeScaleFixed;
|
|
8662
|
+
}
|
|
8616
8663
|
set scale(value) {
|
|
8617
8664
|
MathHelper.assignScale(this, value);
|
|
8618
8665
|
}
|
|
@@ -8668,6 +8715,9 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8668
8715
|
getPathString(curve, pathForRender, floatLength) {
|
|
8669
8716
|
return PathConvert.stringify(this.getPath(curve, pathForRender), floatLength);
|
|
8670
8717
|
}
|
|
8718
|
+
asPath(curve, pathForRender) {
|
|
8719
|
+
this.path = this.getPath(curve, pathForRender);
|
|
8720
|
+
}
|
|
8671
8721
|
load() {
|
|
8672
8722
|
this.__.__computePaint();
|
|
8673
8723
|
}
|
|
@@ -8677,16 +8727,18 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8677
8727
|
data.lazy && !this.__inLazyBounds && !Export.running ? data.__needComputePaint = true : data.__computePaint();
|
|
8678
8728
|
}
|
|
8679
8729
|
}
|
|
8680
|
-
__updateRenderPath() {
|
|
8730
|
+
__updateRenderPath(updateCache) {
|
|
8681
8731
|
const data = this.__;
|
|
8682
8732
|
if (data.path) {
|
|
8683
8733
|
data.__pathForRender = data.cornerRadius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
|
|
8684
|
-
if (data.__useArrow) PathArrow.addArrows(this);
|
|
8734
|
+
if (data.__useArrow) PathArrow.addArrows(this, updateCache);
|
|
8685
8735
|
} else data.__pathForRender && (data.__pathForRender = undefined);
|
|
8686
8736
|
}
|
|
8687
8737
|
__drawRenderPath(canvas) {
|
|
8738
|
+
const data = this.__;
|
|
8688
8739
|
canvas.beginPath();
|
|
8689
|
-
|
|
8740
|
+
if (data.__useArrow) PathArrow.updateArrow(this);
|
|
8741
|
+
this.__drawPathByData(canvas, data.__pathForRender);
|
|
8690
8742
|
}
|
|
8691
8743
|
__drawPath(canvas) {
|
|
8692
8744
|
canvas.beginPath();
|
|
@@ -8735,6 +8787,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8735
8787
|
static setEditOuter(_toolName) {}
|
|
8736
8788
|
static setEditInner(_editorName) {}
|
|
8737
8789
|
destroy() {
|
|
8790
|
+
this.__.__willDestroy = true;
|
|
8738
8791
|
this.fill = this.stroke = null;
|
|
8739
8792
|
if (this.__animate) this.killAnimate();
|
|
8740
8793
|
super.destroy();
|
|
@@ -8851,7 +8904,7 @@ __decorate([ strokeType("inside") ], UI.prototype, "strokeAlign", void 0);
|
|
|
8851
8904
|
|
|
8852
8905
|
__decorate([ strokeType(1, true) ], UI.prototype, "strokeWidth", void 0);
|
|
8853
8906
|
|
|
8854
|
-
__decorate([ strokeType(false) ], UI.prototype, "
|
|
8907
|
+
__decorate([ strokeType(false) ], UI.prototype, "strokeScaleFixed", void 0);
|
|
8855
8908
|
|
|
8856
8909
|
__decorate([ strokeType("none") ], UI.prototype, "strokeCap", void 0);
|
|
8857
8910
|
|
|
@@ -9483,9 +9536,9 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9483
9536
|
return "Ellipse";
|
|
9484
9537
|
}
|
|
9485
9538
|
__updatePath() {
|
|
9486
|
-
const {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} =
|
|
9539
|
+
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = data;
|
|
9487
9540
|
const rx = width / 2, ry = height / 2;
|
|
9488
|
-
const path =
|
|
9541
|
+
const path = data.path = [];
|
|
9489
9542
|
let open;
|
|
9490
9543
|
if (innerRadius) {
|
|
9491
9544
|
if (startAngle || endAngle) {
|
|
@@ -9507,7 +9560,7 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9507
9560
|
}
|
|
9508
9561
|
}
|
|
9509
9562
|
if (!open) closePath$2(path);
|
|
9510
|
-
if (Platform.ellipseToCurve)
|
|
9563
|
+
if (Platform.ellipseToCurve || data.__useArrow) data.path = this.getPath(true);
|
|
9511
9564
|
}
|
|
9512
9565
|
};
|
|
9513
9566
|
|
|
@@ -9731,7 +9784,7 @@ __decorate([ resizeType() ], Canvas.prototype, "contextSettings", void 0);
|
|
|
9731
9784
|
|
|
9732
9785
|
Canvas = __decorate([ registerUI() ], Canvas);
|
|
9733
9786
|
|
|
9734
|
-
const {copyAndSpread: copyAndSpread$
|
|
9787
|
+
const {copyAndSpread: copyAndSpread$3, includes: includes, spread: spread, setList: setList} = BoundsHelper, {stintSet: stintSet$3} = DataHelper;
|
|
9735
9788
|
|
|
9736
9789
|
let Text = class Text extends UI {
|
|
9737
9790
|
get __tag() {
|
|
@@ -9748,9 +9801,9 @@ let Text = class Text extends UI {
|
|
|
9748
9801
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
9749
9802
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
|
|
9750
9803
|
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
|
|
9751
|
-
stintSet$
|
|
9752
|
-
stintSet$
|
|
9753
|
-
stintSet$
|
|
9804
|
+
stintSet$3(data, "__padding", padding && MathHelper.fourNumber(padding));
|
|
9805
|
+
stintSet$3(data, "__clipText", textOverflow !== "show" && !data.__autoSize);
|
|
9806
|
+
stintSet$3(data, "__isCharMode", width || height || data.__letterSpacing || textCase !== "none");
|
|
9754
9807
|
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
|
|
9755
9808
|
}
|
|
9756
9809
|
__updateBoxBounds() {
|
|
@@ -9785,7 +9838,7 @@ let Text = class Text extends UI {
|
|
|
9785
9838
|
}
|
|
9786
9839
|
__updateRenderBounds() {
|
|
9787
9840
|
const {renderBounds: renderBounds, renderSpread: renderSpread} = this.__layout;
|
|
9788
|
-
copyAndSpread$
|
|
9841
|
+
copyAndSpread$3(renderBounds, this.__.__textBoxBounds, renderSpread);
|
|
9789
9842
|
if (this.__box) this.__box.__layout.renderBounds = renderBounds;
|
|
9790
9843
|
}
|
|
9791
9844
|
__updateChange() {
|
|
@@ -10047,7 +10100,7 @@ let App = class App extends Leafer {
|
|
|
10047
10100
|
if (this.viewReady) this.renderer.update();
|
|
10048
10101
|
}
|
|
10049
10102
|
__render(canvas, options) {
|
|
10050
|
-
if (canvas.context) this.forEach(leafer => options.matrix ? leafer.__render(canvas, options) : canvas.copyWorld(leafer.canvas, options.bounds));
|
|
10103
|
+
if (canvas.context) this.forEach(leafer => options.matrix ? leafer.__render(canvas, options) : canvas.copyWorld(leafer.canvas, options.bounds, undefined, undefined, true));
|
|
10051
10104
|
}
|
|
10052
10105
|
__onResize(event) {
|
|
10053
10106
|
this.forEach(leafer => leafer.resize(event));
|
|
@@ -11602,8 +11655,8 @@ function fills(fills, ui, canvas, renderOptions) {
|
|
|
11602
11655
|
canvas.save();
|
|
11603
11656
|
if (item.transform) canvas.transform(item.transform);
|
|
11604
11657
|
if (originPaint.scaleFixed) {
|
|
11605
|
-
const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
11606
|
-
if (
|
|
11658
|
+
const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, originPaint.scaleFixed, false);
|
|
11659
|
+
if (scaleX !== 1) canvas.scale(scaleX, scaleY);
|
|
11607
11660
|
}
|
|
11608
11661
|
if (originPaint.blendMode) canvas.blendMode = originPaint.blendMode;
|
|
11609
11662
|
fillPathOrText(ui, canvas, renderOptions);
|
|
@@ -11774,7 +11827,7 @@ function drawStrokesStyle(strokes, strokeWidthScale, isText, ui, canvas, renderO
|
|
|
11774
11827
|
}
|
|
11775
11828
|
}
|
|
11776
11829
|
|
|
11777
|
-
const {getSpread: getSpread, copyAndSpread: copyAndSpread$
|
|
11830
|
+
const {getSpread: getSpread, copyAndSpread: copyAndSpread$2, toOuterOf: toOuterOf, getOuterOf: getOuterOf, getByMove: getByMove, move: move$7, getIntersectData: getIntersectData} = BoundsHelper;
|
|
11778
11831
|
|
|
11779
11832
|
const tempBounds$2 = {};
|
|
11780
11833
|
|
|
@@ -11782,7 +11835,7 @@ function shape(ui, current, options) {
|
|
|
11782
11835
|
const canvas = current.getSameCanvas();
|
|
11783
11836
|
const currentBounds = current.bounds, nowWorld = ui.__nowWorld, layout = ui.__layout;
|
|
11784
11837
|
const nowWorldShapeBounds = ui.__nowWorldShapeBounds || (ui.__nowWorldShapeBounds = {});
|
|
11785
|
-
toOuterOf(layout.strokeSpread ? (copyAndSpread$
|
|
11838
|
+
toOuterOf(layout.strokeSpread ? (copyAndSpread$2(tempBounds$2, layout.boxBounds, layout.strokeSpread),
|
|
11786
11839
|
tempBounds$2) : layout.boxBounds, nowWorld, nowWorldShapeBounds);
|
|
11787
11840
|
let bounds, renderBounds, matrix, fitMatrix, shapeBounds, worldCanvas;
|
|
11788
11841
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
@@ -11838,7 +11891,7 @@ function shape(ui, current, options) {
|
|
|
11838
11891
|
|
|
11839
11892
|
let recycleMap;
|
|
11840
11893
|
|
|
11841
|
-
const {stintSet: stintSet} = DataHelper, {hasTransparent: hasTransparent$1} = ColorConvert;
|
|
11894
|
+
const {stintSet: stintSet$2} = DataHelper, {hasTransparent: hasTransparent$1} = ColorConvert;
|
|
11842
11895
|
|
|
11843
11896
|
function compute(attrName, ui) {
|
|
11844
11897
|
const data = ui.__, leafPaints = [];
|
|
@@ -11862,12 +11915,12 @@ function compute(attrName, ui) {
|
|
|
11862
11915
|
isTransparent = true;
|
|
11863
11916
|
}
|
|
11864
11917
|
if (attrName === "fill") {
|
|
11865
|
-
stintSet(data, "__isAlphaPixelFill", isAlphaPixel);
|
|
11866
|
-
stintSet(data, "__isTransparentFill", isTransparent);
|
|
11918
|
+
stintSet$2(data, "__isAlphaPixelFill", isAlphaPixel);
|
|
11919
|
+
stintSet$2(data, "__isTransparentFill", isTransparent);
|
|
11867
11920
|
} else {
|
|
11868
|
-
stintSet(data, "__isAlphaPixelStroke", isAlphaPixel);
|
|
11869
|
-
stintSet(data, "__isTransparentStroke", isTransparent);
|
|
11870
|
-
stintSet(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
11921
|
+
stintSet$2(data, "__isAlphaPixelStroke", isAlphaPixel);
|
|
11922
|
+
stintSet$2(data, "__isTransparentStroke", isTransparent);
|
|
11923
|
+
stintSet$2(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
11871
11924
|
}
|
|
11872
11925
|
} else {
|
|
11873
11926
|
data.__removePaint(attrName, false);
|
|
@@ -11940,12 +11993,12 @@ const PaintModule = {
|
|
|
11940
11993
|
|
|
11941
11994
|
let cache$1, box$2 = new Bounds;
|
|
11942
11995
|
|
|
11943
|
-
const {isSame: isSame} = BoundsHelper;
|
|
11996
|
+
const {isSame: isSame$1} = BoundsHelper;
|
|
11944
11997
|
|
|
11945
11998
|
function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
11946
11999
|
let leafPaint, event;
|
|
11947
12000
|
const image = ImageManager.get(paint, paint.type);
|
|
11948
|
-
if (cache$1 && paint === cache$1.paint && isSame(boxBounds, cache$1.boxBounds)) {
|
|
12001
|
+
if (cache$1 && paint === cache$1.paint && isSame$1(boxBounds, cache$1.boxBounds)) {
|
|
11949
12002
|
leafPaint = cache$1.leafPaint;
|
|
11950
12003
|
} else {
|
|
11951
12004
|
leafPaint = {
|
|
@@ -12024,6 +12077,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
12024
12077
|
const clip = transform && !transform.onlyScale || data.path || data.cornerRadius;
|
|
12025
12078
|
if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
|
|
12026
12079
|
}
|
|
12080
|
+
if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
|
|
12027
12081
|
return true;
|
|
12028
12082
|
}
|
|
12029
12083
|
|
|
@@ -12231,7 +12285,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
|
|
|
12231
12285
|
translate(transform, box.x + x, box.y + y);
|
|
12232
12286
|
}
|
|
12233
12287
|
|
|
12234
|
-
const {get: get$1, scale: scale$
|
|
12288
|
+
const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
|
|
12235
12289
|
|
|
12236
12290
|
const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$6} = Math;
|
|
12237
12291
|
|
|
@@ -12251,7 +12305,7 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
12251
12305
|
let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
|
|
12252
12306
|
if (paint.patternId !== id && !ui.destroyed) {
|
|
12253
12307
|
if (!(Platform.image.isLarge(paint.image, scaleX, scaleY) && !paint.data.repeat)) {
|
|
12254
|
-
const {image: image, data: data} = paint, {opacity: opacity
|
|
12308
|
+
const {image: image, data: data} = paint, {opacity: opacity} = paint.originPaint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
|
|
12255
12309
|
let imageMatrix, xGap, yGap, {width: width, height: height} = image;
|
|
12256
12310
|
if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
|
|
12257
12311
|
width *= scaleX;
|
|
@@ -12265,9 +12319,9 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
12265
12319
|
scaleY *= getFloorScale(height + (yGap || 0));
|
|
12266
12320
|
imageMatrix = get$1();
|
|
12267
12321
|
if (transform) copy$4(imageMatrix, transform);
|
|
12268
|
-
scale$
|
|
12322
|
+
scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
12269
12323
|
}
|
|
12270
|
-
const imageCanvas = image.getCanvas(width, height, opacity,
|
|
12324
|
+
const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
|
|
12271
12325
|
const pattern = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
|
|
12272
12326
|
paint.style = pattern;
|
|
12273
12327
|
paint.patternId = id;
|
|
@@ -12358,6 +12412,7 @@ function recycleImage(attrName, data) {
|
|
|
12358
12412
|
if (!recycleMap) recycleMap = {};
|
|
12359
12413
|
recycleMap[url] = true;
|
|
12360
12414
|
ImageManager.recyclePaint(paint);
|
|
12415
|
+
if (data.__willDestroy && image.parent) PaintImage.recycleFilter(image, data.__leaf);
|
|
12361
12416
|
if (image.loading) {
|
|
12362
12417
|
if (!input) {
|
|
12363
12418
|
input = data.__input && data.__input[attrName] || [];
|
|
@@ -13327,8 +13382,11 @@ function targetAttr(fn) {
|
|
|
13327
13382
|
});
|
|
13328
13383
|
if (isObject(check)) value = check; else if (check === false) return;
|
|
13329
13384
|
}
|
|
13330
|
-
t.
|
|
13331
|
-
|
|
13385
|
+
const {dimOthers: dimOthers, bright: bright} = t.editBox.mergedConfig || t.config;
|
|
13386
|
+
if (!isUndefined(dimOthers) || !isUndefined(bright)) {
|
|
13387
|
+
t.setDimOthers(false);
|
|
13388
|
+
t.setBright(false);
|
|
13389
|
+
}
|
|
13332
13390
|
if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
|
|
13333
13391
|
if (t.single) {
|
|
13334
13392
|
delete t.element.syncEventer;
|
|
@@ -13353,7 +13411,8 @@ function mergeConfigAttr() {
|
|
|
13353
13411
|
return (target, key) => {
|
|
13354
13412
|
defineKey(target, key, {
|
|
13355
13413
|
get() {
|
|
13356
|
-
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, app: app} = this, mergeConfig = Object.assign({}, config);
|
|
13414
|
+
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, editTool: editTool, innerEditor: innerEditor, app: app} = this, mergeConfig = Object.assign({}, config);
|
|
13415
|
+
if (innerEditor) innerEditor.editConfig && Object.assign(mergeConfig, innerEditor.editConfig); else if (editTool) editTool.editConfig && Object.assign(mergeConfig, editTool.editConfig);
|
|
13357
13416
|
if (element && element.editConfig) {
|
|
13358
13417
|
let {editConfig: editConfig} = element;
|
|
13359
13418
|
if (editConfig.hover || editConfig.hoverStyle) {
|
|
@@ -14256,8 +14315,10 @@ class EditBox extends Group {
|
|
|
14256
14315
|
const {editMask: editMask} = editor;
|
|
14257
14316
|
const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
|
|
14258
14317
|
editMask.visible = mask ? true : 0;
|
|
14259
|
-
|
|
14260
|
-
|
|
14318
|
+
if (!isUndefined(dimOthers) || !isUndefined(bright)) {
|
|
14319
|
+
editor.setDimOthers(dimOthers);
|
|
14320
|
+
editor.setBright(!!dimOthers || bright);
|
|
14321
|
+
}
|
|
14261
14322
|
if (spread) BoundsHelper.spread(bounds, spread);
|
|
14262
14323
|
if (this.view.worldOpacity) {
|
|
14263
14324
|
const {width: width, height: height} = bounds;
|
|
@@ -14276,7 +14337,8 @@ class EditBox extends Group {
|
|
|
14276
14337
|
resizeL = resizeLines[(i - 1) / 2];
|
|
14277
14338
|
resizeL.set(point);
|
|
14278
14339
|
resizeL.visible = resizeP.visible && !hideResizeLines;
|
|
14279
|
-
resizeP.visible
|
|
14340
|
+
if (resizeP.visible) resizeP.visible = !!middlePoint;
|
|
14341
|
+
if (rotateP.visible) rotateP.visible = !!middlePoint;
|
|
14280
14342
|
if ((i + 1) / 2 % 2) {
|
|
14281
14343
|
resizeL.width = width + resizeL.height;
|
|
14282
14344
|
if (hideOnSmall && resizeP.width * 2 > width) resizeP.visible = false;
|
|
@@ -16835,7 +16897,7 @@ Arrow = __decorate([ registerUI() ], Arrow);
|
|
|
16835
16897
|
|
|
16836
16898
|
const {M: M$2, L: L$2, C: C$2, Q: Q$1, O: O$1} = PathCommandMap;
|
|
16837
16899
|
|
|
16838
|
-
const {rotate: rotate$1, copyFrom: copyFrom$1, scale: scale} = PointHelper;
|
|
16900
|
+
const {rotate: rotate$1, copyFrom: copyFrom$1, scale: scale$1} = PointHelper;
|
|
16839
16901
|
|
|
16840
16902
|
const point$1 = {};
|
|
16841
16903
|
|
|
@@ -16882,7 +16944,7 @@ const PathMatrixHelper = {
|
|
|
16882
16944
|
function setPoint$2(data, startIndex, x, y, scaleX, scaleY, rotation, origin) {
|
|
16883
16945
|
copyFrom$1(point$1, data[startIndex], data[startIndex + 1]);
|
|
16884
16946
|
if (rotation) rotate$1(point$1, rotation, origin);
|
|
16885
|
-
if (scaleX) scale(point$1, scaleX, scaleY);
|
|
16947
|
+
if (scaleX) scale$1(point$1, scaleX, scaleY);
|
|
16886
16948
|
data[startIndex] = x + point$1.x;
|
|
16887
16949
|
data[startIndex + 1] = y + point$1.y;
|
|
16888
16950
|
}
|
|
@@ -16891,12 +16953,14 @@ const {layout: layout$2, rotate: rotate} = PathMatrixHelper;
|
|
|
16891
16953
|
|
|
16892
16954
|
const {getAngle: getAngle} = PointHelper;
|
|
16893
16955
|
|
|
16894
|
-
const
|
|
16956
|
+
const zero = {
|
|
16957
|
+
x: 0
|
|
16958
|
+
}, half = {
|
|
16895
16959
|
x: -.5
|
|
16896
16960
|
};
|
|
16897
16961
|
|
|
16898
16962
|
const angle = {
|
|
16899
|
-
connect:
|
|
16963
|
+
connect: zero,
|
|
16900
16964
|
offset: {
|
|
16901
16965
|
x: -.71,
|
|
16902
16966
|
bevelJoin: .36,
|
|
@@ -16917,73 +16981,110 @@ const angleSide = {
|
|
|
16917
16981
|
|
|
16918
16982
|
const triangleLinePath = [ 1, -3, 0, 2, -3, -2, 2, 0, 0, 2, -3, 2, 2, -3, 0 ];
|
|
16919
16983
|
|
|
16920
|
-
const
|
|
16921
|
-
connect:
|
|
16984
|
+
const triangleFill = {
|
|
16985
|
+
connect: zero,
|
|
16922
16986
|
offset: {
|
|
16923
16987
|
x: -.9,
|
|
16924
16988
|
bevelJoin: .624,
|
|
16925
16989
|
roundJoin: .4
|
|
16926
16990
|
},
|
|
16927
|
-
path: [ ...triangleLinePath
|
|
16928
|
-
dashPath: [ 1, -2, 0, 2, -.5, 0 ]
|
|
16991
|
+
path: [ ...triangleLinePath ]
|
|
16929
16992
|
};
|
|
16930
16993
|
|
|
16931
|
-
const
|
|
16994
|
+
const triangle = DataHelper.clone(triangleFill);
|
|
16932
16995
|
|
|
16933
|
-
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
path: [ ...
|
|
16941
|
-
dashPath: [ 1, -3, 0, 2, -.5, 0 ]
|
|
16996
|
+
triangle.path = [ ...triangleLinePath, 1, -2.05, 1.1, 2, -2.05, -1.1 ];
|
|
16997
|
+
|
|
16998
|
+
triangle.dashPath = [ 1, -2, 0, 2, -.5, 0 ];
|
|
16999
|
+
|
|
17000
|
+
const triangleFlipFill = {
|
|
17001
|
+
connect: zero,
|
|
17002
|
+
offset: half,
|
|
17003
|
+
path: [ ...triangleFill.path ]
|
|
16942
17004
|
};
|
|
16943
17005
|
|
|
16944
17006
|
const triangleFlip = {
|
|
17007
|
+
connect: zero,
|
|
16945
17008
|
offset: half,
|
|
16946
17009
|
path: [ ...triangle.path ],
|
|
16947
17010
|
dashPath: [ 1, -2.5, 0, 2, -1, 0 ]
|
|
16948
17011
|
};
|
|
16949
17012
|
|
|
17013
|
+
rotate(triangleFlipFill.path, 180, {
|
|
17014
|
+
x: -1.5,
|
|
17015
|
+
y: 0
|
|
17016
|
+
});
|
|
17017
|
+
|
|
16950
17018
|
rotate(triangleFlip.path, 180, {
|
|
16951
17019
|
x: -1.5,
|
|
16952
17020
|
y: 0
|
|
16953
17021
|
});
|
|
16954
17022
|
|
|
17023
|
+
const arrowLinePath = [ 1, -3, 0, 2, -3.5, -1.8, 2, 0, 0, 2, -3.5, 1.8, 2, -3, 0 ];
|
|
17024
|
+
|
|
17025
|
+
const arrowFill = {
|
|
17026
|
+
connect: zero,
|
|
17027
|
+
offset: {
|
|
17028
|
+
x: -1.1,
|
|
17029
|
+
bevelJoin: .872,
|
|
17030
|
+
roundJoin: .6
|
|
17031
|
+
},
|
|
17032
|
+
path: [ ...arrowLinePath ]
|
|
17033
|
+
};
|
|
17034
|
+
|
|
17035
|
+
const arrow = DataHelper.clone(arrowFill);
|
|
17036
|
+
|
|
17037
|
+
arrow.path = [ ...arrowLinePath, 1, -2.25, .95, 2, -2.25, -.95 ];
|
|
17038
|
+
|
|
17039
|
+
arrow.dashPath = [ 1, -3, 0, 2, -.5, 0 ];
|
|
17040
|
+
|
|
16955
17041
|
const circleLine = {
|
|
16956
17042
|
connect: {
|
|
16957
|
-
x: -1.
|
|
17043
|
+
x: -1.8
|
|
16958
17044
|
},
|
|
16959
17045
|
path: [ 1, 1.8, -.1, 2, 1.8, 0, 26, 0, 0, 1.8, 0, 359, 0 ]
|
|
16960
17046
|
};
|
|
16961
17047
|
|
|
16962
|
-
const
|
|
17048
|
+
const circleFill = {
|
|
16963
17049
|
connect: {
|
|
16964
17050
|
x: .5
|
|
16965
17051
|
},
|
|
16966
|
-
path: [ ...circleLine.path
|
|
16967
|
-
dashPath: [ 1, -.5, 0, 2, .5, 0 ]
|
|
17052
|
+
path: [ ...circleLine.path ]
|
|
16968
17053
|
};
|
|
16969
17054
|
|
|
17055
|
+
const circle = DataHelper.clone(circleFill);
|
|
17056
|
+
|
|
17057
|
+
circle.path = [ ...circleLine.path, 1, 0, 0, 26, 0, 0, 1, 0, 360, 0 ];
|
|
17058
|
+
|
|
17059
|
+
circle.dashPath = [ 1, -.5, 0, 2, .5, 0 ];
|
|
17060
|
+
|
|
16970
17061
|
const squareLine = {
|
|
16971
17062
|
connect: {
|
|
16972
|
-
x: -1.
|
|
17063
|
+
x: -1.4
|
|
16973
17064
|
},
|
|
16974
17065
|
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 ]
|
|
16975
17066
|
};
|
|
16976
17067
|
|
|
17068
|
+
const squareFill = {
|
|
17069
|
+
path: [ ...squareLine.path ]
|
|
17070
|
+
};
|
|
17071
|
+
|
|
16977
17072
|
const square = {
|
|
16978
17073
|
path: [ ...squareLine.path, 2, -1.4, -.49, 2, 1, -.49, 1, -1.4, .49, 2, 1, .49 ]
|
|
16979
17074
|
};
|
|
16980
17075
|
|
|
16981
17076
|
const diamondLine = DataHelper.clone(squareLine);
|
|
16982
17077
|
|
|
17078
|
+
diamondLine.connect.x = -1.9;
|
|
17079
|
+
|
|
17080
|
+
const diamondFill = DataHelper.clone(squareFill);
|
|
17081
|
+
|
|
16983
17082
|
const diamond = DataHelper.clone(square);
|
|
16984
17083
|
|
|
16985
17084
|
rotate(diamondLine.path, 45);
|
|
16986
17085
|
|
|
17086
|
+
rotate(diamondFill.path, 45);
|
|
17087
|
+
|
|
16987
17088
|
rotate(diamond.path, 45);
|
|
16988
17089
|
|
|
16989
17090
|
const mark = {
|
|
@@ -17006,19 +17107,34 @@ const arrows = {
|
|
|
17006
17107
|
mark: mark
|
|
17007
17108
|
};
|
|
17008
17109
|
|
|
17110
|
+
const fillArrows = {
|
|
17111
|
+
triangle: triangleFill,
|
|
17112
|
+
"triangle-flip": triangleFlipFill,
|
|
17113
|
+
arrow: arrowFill,
|
|
17114
|
+
circle: circleFill,
|
|
17115
|
+
square: squareFill,
|
|
17116
|
+
diamond: diamondFill
|
|
17117
|
+
};
|
|
17118
|
+
|
|
17009
17119
|
function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern) {
|
|
17010
|
-
let pathData, scale;
|
|
17120
|
+
let pathData, scale = 1, rotation = 0, fill;
|
|
17011
17121
|
const {strokeCap: strokeCap, strokeJoin: strokeJoin} = ui.__;
|
|
17012
17122
|
if (isObject(arrow)) {
|
|
17013
17123
|
if (arrow.type) {
|
|
17014
|
-
scale = arrow.scale;
|
|
17124
|
+
scale = arrow.scale || 1;
|
|
17125
|
+
rotation = arrow.rotation || 0;
|
|
17015
17126
|
pathData = arrows[arrow.type];
|
|
17127
|
+
if (scale > 1) {
|
|
17128
|
+
const fillData = fillArrows[arrow.type];
|
|
17129
|
+
if (fillData) pathData = fillData, fill = true;
|
|
17130
|
+
}
|
|
17016
17131
|
} else pathData = arrow;
|
|
17017
17132
|
} else {
|
|
17018
17133
|
pathData = arrows[arrow];
|
|
17019
17134
|
}
|
|
17135
|
+
if (!fill) fill = pathData.fill;
|
|
17020
17136
|
const {offset: offset, connect: connect, path: path, dashPath: dashPath} = pathData;
|
|
17021
|
-
let connectX = connect ? connect.x : 0;
|
|
17137
|
+
let connectX = connect ? connect.x * scale : 0;
|
|
17022
17138
|
let offsetX = offset ? offset.x : 0;
|
|
17023
17139
|
const data = [ ...path ];
|
|
17024
17140
|
if (hasDashPattern && dashPath) data.push(...dashPath);
|
|
@@ -17026,28 +17142,38 @@ function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern)
|
|
|
17026
17142
|
if (offset) {
|
|
17027
17143
|
if (strokeJoin === "round" && offset.roundJoin) offsetX += offset.roundJoin; else if (strokeJoin === "bevel" && offset.bevelJoin) offsetX += offset.bevelJoin;
|
|
17028
17144
|
}
|
|
17029
|
-
if (scale) layout$2(data, 0, 0, scale, scale);
|
|
17145
|
+
if (scale !== 1) layout$2(data, 0, 0, scale, scale);
|
|
17030
17146
|
if (offsetX) layout$2(data, offsetX, 0);
|
|
17031
|
-
layout$2(data, to.x, to.y, size, size, getAngle(from, to));
|
|
17147
|
+
layout$2(data, to.x, to.y, size, size, getAngle(from, to) + rotation);
|
|
17032
17148
|
connectOffset.x = (connectX + offsetX) * size;
|
|
17033
|
-
|
|
17149
|
+
const arrowData = {
|
|
17150
|
+
data: data
|
|
17151
|
+
};
|
|
17152
|
+
if (fill) arrowData.fill = fill;
|
|
17153
|
+
return arrowData;
|
|
17034
17154
|
}
|
|
17035
17155
|
|
|
17036
17156
|
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;
|
|
17037
17157
|
|
|
17038
|
-
const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint} = PointHelper;
|
|
17158
|
+
const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint, isSame: isSame} = PointHelper;
|
|
17159
|
+
|
|
17160
|
+
const {stintSet: stintSet$1} = DataHelper;
|
|
17039
17161
|
|
|
17040
17162
|
const connectPoint = {};
|
|
17041
17163
|
|
|
17042
17164
|
const first = {}, second = {};
|
|
17043
17165
|
|
|
17044
|
-
const last = {}, now = {};
|
|
17166
|
+
const old = {}, last = {}, now = {};
|
|
17045
17167
|
|
|
17046
17168
|
const PathArrowModule = {
|
|
17047
17169
|
list: arrows,
|
|
17048
|
-
|
|
17049
|
-
|
|
17170
|
+
fillList: fillArrows,
|
|
17171
|
+
addArrows(ui, updateCache) {
|
|
17172
|
+
const uData = ui.__;
|
|
17173
|
+
const {startArrow: startArrow, endArrow: endArrow, __strokeWidth: strokeWidth, dashPattern: dashPattern, __pathForRender: data, cornerRadius: cornerRadius} = uData;
|
|
17050
17174
|
const clonePathForArrow = !cornerRadius;
|
|
17175
|
+
if (!updateCache) uData.__strokeWidthCache = strokeWidth;
|
|
17176
|
+
let startArrowPath, singleStartArrow, endArrowPath, singleEndArrow;
|
|
17051
17177
|
let command, i = 0, len = data.length, count = 0, useStartArrow = startArrow && startArrow !== "none";
|
|
17052
17178
|
while (i < len) {
|
|
17053
17179
|
command = data[i];
|
|
@@ -17055,6 +17181,7 @@ const PathArrowModule = {
|
|
|
17055
17181
|
case M$1:
|
|
17056
17182
|
case L$1:
|
|
17057
17183
|
if (count < 2 || i + 6 >= len) {
|
|
17184
|
+
copy(old, now);
|
|
17058
17185
|
copyFrom(now, data[i + 1], data[i + 2]);
|
|
17059
17186
|
if (!count && useStartArrow) copy(first, now);
|
|
17060
17187
|
}
|
|
@@ -17062,12 +17189,18 @@ const PathArrowModule = {
|
|
|
17062
17189
|
break;
|
|
17063
17190
|
|
|
17064
17191
|
case C$1:
|
|
17065
|
-
if (count === 1 || i + 7 >= len - 3)
|
|
17192
|
+
if (count === 1 || i + 7 >= len - 3) {
|
|
17193
|
+
copyPoints(data, last, now, i + 3);
|
|
17194
|
+
old.x = data[i + 1], old.y = data[i + 2];
|
|
17195
|
+
}
|
|
17066
17196
|
i += 7;
|
|
17067
17197
|
break;
|
|
17068
17198
|
|
|
17069
17199
|
case Q:
|
|
17070
|
-
if (count === 1 || i + 5 >= len - 3)
|
|
17200
|
+
if (count === 1 || i + 5 >= len - 3) {
|
|
17201
|
+
copyPoints(data, last, now, i + 1);
|
|
17202
|
+
copy(old, last);
|
|
17203
|
+
}
|
|
17071
17204
|
i += 5;
|
|
17072
17205
|
break;
|
|
17073
17206
|
|
|
@@ -17105,6 +17238,7 @@ const PathArrowModule = {
|
|
|
17105
17238
|
case U:
|
|
17106
17239
|
if (count === 1 || i + 6 >= len - 3) {
|
|
17107
17240
|
copyPoints(data, last, now, i + 1);
|
|
17241
|
+
copy(old, last);
|
|
17108
17242
|
if (i + 6 !== len) {
|
|
17109
17243
|
now.x -= (now.x - last.x) / 10;
|
|
17110
17244
|
now.y -= (now.y - last.y) / 10;
|
|
@@ -17115,13 +17249,13 @@ const PathArrowModule = {
|
|
|
17115
17249
|
}
|
|
17116
17250
|
count++;
|
|
17117
17251
|
if (count === 1 && command !== M$1) return;
|
|
17118
|
-
if (count === 2 && useStartArrow) copy(second, command === L$1 ? now : last);
|
|
17252
|
+
if (count === 2 && useStartArrow) copy(second, command === L$1 ? now : isSame(old, first) ? last : old);
|
|
17119
17253
|
if (i === len) {
|
|
17120
|
-
const path =
|
|
17121
|
-
const pathForArrow = ui.__.__pathForArrow = [];
|
|
17254
|
+
const path = uData.__pathForRender = clonePathForArrow ? [ ...data ] : data;
|
|
17122
17255
|
if (useStartArrow) {
|
|
17123
|
-
|
|
17124
|
-
|
|
17256
|
+
startArrowPath = getArrowPath(ui, startArrow, second, first, strokeWidth, connectPoint, !!dashPattern);
|
|
17257
|
+
singleStartArrow = startArrowPath.fill || dashPattern;
|
|
17258
|
+
if (!singleStartArrow) path.push(...startArrowPath.data);
|
|
17125
17259
|
if (connectPoint.x) {
|
|
17126
17260
|
getDistancePoint(first, second, -connectPoint.x, true);
|
|
17127
17261
|
path[1] = second.x;
|
|
@@ -17129,8 +17263,10 @@ const PathArrowModule = {
|
|
|
17129
17263
|
}
|
|
17130
17264
|
}
|
|
17131
17265
|
if (endArrow && endArrow !== "none") {
|
|
17132
|
-
|
|
17133
|
-
|
|
17266
|
+
if (isSame(last, now)) copy(last, old);
|
|
17267
|
+
endArrowPath = getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint, !!dashPattern);
|
|
17268
|
+
singleEndArrow = endArrowPath.fill || dashPattern;
|
|
17269
|
+
if (!singleEndArrow) path.push(...endArrowPath.data);
|
|
17134
17270
|
if (connectPoint.x) {
|
|
17135
17271
|
getDistancePoint(now, last, -connectPoint.x, true);
|
|
17136
17272
|
let index;
|
|
@@ -17157,10 +17293,21 @@ const PathArrowModule = {
|
|
|
17157
17293
|
} else {
|
|
17158
17294
|
copy(last, now);
|
|
17159
17295
|
}
|
|
17296
|
+
stintSet$1(uData, "__startArrowPath", singleStartArrow && startArrowPath);
|
|
17297
|
+
stintSet$1(uData, "__endArrowPath", singleEndArrow && endArrowPath);
|
|
17160
17298
|
}
|
|
17161
17299
|
},
|
|
17162
|
-
|
|
17300
|
+
updateArrow(ui) {
|
|
17301
|
+
const data = ui.__;
|
|
17302
|
+
if (data.strokeScaleFixed) {
|
|
17303
|
+
if (data.__strokeWidthCache !== data.__strokeWidth) {
|
|
17304
|
+
ui.__updateRenderPath(true);
|
|
17305
|
+
}
|
|
17306
|
+
}
|
|
17307
|
+
},
|
|
17308
|
+
register(name, data, fillData) {
|
|
17163
17309
|
this.list[name] = data;
|
|
17310
|
+
if (fillData) this.fillList[name] = data;
|
|
17164
17311
|
},
|
|
17165
17312
|
get(name) {
|
|
17166
17313
|
return this.list[name];
|
|
@@ -17186,12 +17333,26 @@ UI.addAttr("endArrow", "none", arrowType);
|
|
|
17186
17333
|
Object.assign(PathArrow, PathArrowModule);
|
|
17187
17334
|
|
|
17188
17335
|
Object.assign(Paint, {
|
|
17189
|
-
strokeArrow(
|
|
17190
|
-
|
|
17336
|
+
strokeArrow(stroke, ui, canvas, _renderOptions) {
|
|
17337
|
+
const {__startArrowPath: __startArrowPath, __endArrowPath: __endArrowPath, dashPattern: dashPattern} = ui.__;
|
|
17338
|
+
if (dashPattern) canvas.dashPattern = null;
|
|
17339
|
+
if (__startArrowPath) {
|
|
17340
|
+
canvas.beginPath();
|
|
17341
|
+
ui.__drawPathByData(canvas, __startArrowPath.data);
|
|
17342
|
+
canvas.stroke();
|
|
17343
|
+
if (__startArrowPath.fill) {
|
|
17344
|
+
canvas.fillStyle = stroke;
|
|
17345
|
+
canvas.fill();
|
|
17346
|
+
}
|
|
17347
|
+
}
|
|
17348
|
+
if (__endArrowPath) {
|
|
17191
17349
|
canvas.beginPath();
|
|
17192
|
-
ui.__drawPathByData(canvas,
|
|
17193
|
-
canvas.dashPattern = null;
|
|
17350
|
+
ui.__drawPathByData(canvas, __endArrowPath.data);
|
|
17194
17351
|
canvas.stroke();
|
|
17352
|
+
if (__endArrowPath.fill) {
|
|
17353
|
+
canvas.fillStyle = stroke;
|
|
17354
|
+
canvas.fill();
|
|
17355
|
+
}
|
|
17195
17356
|
}
|
|
17196
17357
|
}
|
|
17197
17358
|
});
|
|
@@ -17653,7 +17814,7 @@ UI.addAttr("autoHeight", undefined, autoBoundsType);
|
|
|
17653
17814
|
|
|
17654
17815
|
UI.addAttr("autoBox", undefined, boundsType);
|
|
17655
17816
|
|
|
17656
|
-
const {copyAndSpread: copyAndSpread} = BoundsHelper;
|
|
17817
|
+
const {copyAndSpread: copyAndSpread$1} = BoundsHelper;
|
|
17657
17818
|
|
|
17658
17819
|
box$1.__updateFlowLayout = function() {
|
|
17659
17820
|
const {leaferIsCreated: leaferIsCreated, flow: flow} = this;
|
|
@@ -17685,7 +17846,7 @@ box$1.__updateContentBounds = function() {
|
|
|
17685
17846
|
const same = layout.contentBounds === layout.boxBounds;
|
|
17686
17847
|
if (padding) {
|
|
17687
17848
|
if (same) layout.shrinkContent();
|
|
17688
|
-
copyAndSpread(layout.contentBounds, layout.boxBounds, padding, true);
|
|
17849
|
+
copyAndSpread$1(layout.contentBounds, layout.boxBounds, padding, true);
|
|
17689
17850
|
} else {
|
|
17690
17851
|
if (!same) layout.shrinkContentCancel();
|
|
17691
17852
|
}
|
|
@@ -17707,7 +17868,7 @@ box$1.__updateBoxBounds = function(secondLayout) {
|
|
|
17707
17868
|
boxBounds.width = data.width, boxBounds.x = 0;
|
|
17708
17869
|
}
|
|
17709
17870
|
}
|
|
17710
|
-
flow && secondLayout && data.padding && copyAndSpread(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : data.__autoWidth ? "width" : "height");
|
|
17871
|
+
flow && secondLayout && data.padding && copyAndSpread$1(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : data.__autoWidth ? "width" : "height");
|
|
17711
17872
|
this.__updateNaturalSize();
|
|
17712
17873
|
} else {
|
|
17713
17874
|
this.__updateRectBoxBounds();
|
|
@@ -19691,9 +19852,7 @@ const {Yes: Yes, NoAndSkip: NoAndSkip, YesAndSkip: YesAndSkip} = Answer;
|
|
|
19691
19852
|
const idCondition = {}, classNameCondition = {}, tagCondition = {};
|
|
19692
19853
|
|
|
19693
19854
|
class Finder {
|
|
19694
|
-
constructor(target) {
|
|
19695
|
-
this.innerIdMap = {};
|
|
19696
|
-
this.idMap = {};
|
|
19855
|
+
constructor(target, _config) {
|
|
19697
19856
|
this.methods = {
|
|
19698
19857
|
id: (leaf, name) => leaf.id === name ? (this.target && (this.idMap[name] = leaf),
|
|
19699
19858
|
1) : 0,
|
|
@@ -19703,6 +19862,13 @@ class Finder {
|
|
|
19703
19862
|
tag: (leaf, name) => leaf.__tag === name ? 1 : 0,
|
|
19704
19863
|
tags: (leaf, nameMap) => nameMap[leaf.__tag] ? 1 : 0
|
|
19705
19864
|
};
|
|
19865
|
+
this.idMap = {};
|
|
19866
|
+
this.innerIdMap = {};
|
|
19867
|
+
const app = target && target.app;
|
|
19868
|
+
if (app) {
|
|
19869
|
+
app.idMap ? this.idMap = app.idMap : app.idMap = this.idMap;
|
|
19870
|
+
app.innerIdMap ? this.innerIdMap = app.innerIdMap : app.innerIdMap = this.innerIdMap;
|
|
19871
|
+
}
|
|
19706
19872
|
if (this.target = target) this.__listenEvents();
|
|
19707
19873
|
}
|
|
19708
19874
|
getBy(condition, branch, one, options) {
|
|
@@ -19829,8 +19995,14 @@ ui.findOne = function(condition, options) {
|
|
|
19829
19995
|
|
|
19830
19996
|
Plugin.add("find");
|
|
19831
19997
|
|
|
19832
|
-
Creator.finder = function(target) {
|
|
19833
|
-
return new Finder(target);
|
|
19998
|
+
Creator.finder = function(target, config) {
|
|
19999
|
+
return new Finder(target, config);
|
|
20000
|
+
};
|
|
20001
|
+
|
|
20002
|
+
LeafHelper.cacheId = function(t) {
|
|
20003
|
+
const {leafer: leafer, id: id} = t;
|
|
20004
|
+
if (id) leafer.app.idMap[id] = t;
|
|
20005
|
+
if (leafer.cacheInnerId) leafer.app.innerIdMap[t.innerId] = t;
|
|
19834
20006
|
};
|
|
19835
20007
|
|
|
19836
20008
|
const {setPoint: setPoint, addPoint: addPoint, toBounds: toBounds} = TwoPointBoundsHelper;
|
|
@@ -20123,7 +20295,7 @@ const config = {
|
|
|
20123
20295
|
style: {
|
|
20124
20296
|
dragBoundsType: "outer",
|
|
20125
20297
|
strokeAlign: "center",
|
|
20126
|
-
|
|
20298
|
+
strokeScaleFixed: "zoom-in",
|
|
20127
20299
|
width: 6,
|
|
20128
20300
|
height: 6,
|
|
20129
20301
|
opacity: .5,
|
|
@@ -20372,4 +20544,48 @@ Scroller.registerTheme("dark", {
|
|
|
20372
20544
|
}
|
|
20373
20545
|
});
|
|
20374
20546
|
|
|
20547
|
+
const {stintSet: stintSet} = DataHelper;
|
|
20548
|
+
|
|
20549
|
+
function scaleFixedType(defaultValue) {
|
|
20550
|
+
return decorateLeafAttr(defaultValue, key => attr({
|
|
20551
|
+
set(value) {
|
|
20552
|
+
if (this.__setAttr(key, value)) {
|
|
20553
|
+
const layout = this.__layout;
|
|
20554
|
+
doBoundsType(this);
|
|
20555
|
+
if (!isNumber(value)) value = value ? 1 : 0;
|
|
20556
|
+
stintSet(layout, "scaleFixed", value);
|
|
20557
|
+
stintSet(layout, "outerScale", value ? 1 / value : 0);
|
|
20558
|
+
if (!layout.outerScale && layout.localOuterBounds) layout.localOuterBounds = undefined;
|
|
20559
|
+
}
|
|
20560
|
+
}
|
|
20561
|
+
}));
|
|
20562
|
+
}
|
|
20563
|
+
|
|
20564
|
+
const {scale: scale} = MatrixHelper;
|
|
20565
|
+
|
|
20566
|
+
const {copyAndSpread: copyAndSpread} = BoundsHelper;
|
|
20567
|
+
|
|
20568
|
+
const {getScaleFixedData: getScaleFixedData} = MathHelper;
|
|
20569
|
+
|
|
20570
|
+
LeafHelper.updateScaleFixedWorld = function(t) {
|
|
20571
|
+
const {__world: __world, __: __} = t, {scaleX: scaleX, scaleY: scaleY} = getScaleFixedData(__world, __.scaleFixed);
|
|
20572
|
+
if (scaleX !== 1) {
|
|
20573
|
+
scale(__world, scaleX, scaleY);
|
|
20574
|
+
__world.scaleX *= scaleX, __world.scaleY *= scaleY;
|
|
20575
|
+
}
|
|
20576
|
+
};
|
|
20577
|
+
|
|
20578
|
+
LeafHelper.updateOuterBounds = function(t) {
|
|
20579
|
+
const layout = t.__layout, {localRenderBounds: localRenderBounds} = layout;
|
|
20580
|
+
const localOuterBounds = layout.localOuterBounds || (layout.localOuterBounds = {});
|
|
20581
|
+
const {width: width, height: height} = localRenderBounds;
|
|
20582
|
+
const scale = layout.outerScale - 1;
|
|
20583
|
+
copyAndSpread(localOuterBounds, localRenderBounds, [ height * scale, width * scale ]);
|
|
20584
|
+
if (t.parent) t.parent.__layout.renderChange();
|
|
20585
|
+
};
|
|
20586
|
+
|
|
20587
|
+
Plugin.add("scale-fixed");
|
|
20588
|
+
|
|
20589
|
+
UI.addAttr("scaleFixed", undefined, scaleFixedType);
|
|
20590
|
+
|
|
20375
20591
|
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, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, 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, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, 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 };
|