@leafer/worker 1.9.6 → 1.9.7
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 +11 -0
- package/dist/worker.esm.js +2 -0
- package/dist/worker.esm.min.js +1 -1
- package/dist/worker.js +101 -50
- package/dist/worker.min.cjs +1 -1
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +106 -52
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +23 -22
- package/src/index.ts +2 -0
- package/types/index.d.ts +1 -0
package/dist/worker.module.js
CHANGED
|
@@ -423,6 +423,15 @@ const MatrixHelper = {
|
|
|
423
423
|
t.c *= scaleY;
|
|
424
424
|
t.d *= scaleY;
|
|
425
425
|
},
|
|
426
|
+
pixelScale(t, pixelRatio, to) {
|
|
427
|
+
to || (to = t);
|
|
428
|
+
to.a = t.a * pixelRatio;
|
|
429
|
+
to.b = t.b * pixelRatio;
|
|
430
|
+
to.c = t.c * pixelRatio;
|
|
431
|
+
to.d = t.d * pixelRatio;
|
|
432
|
+
to.e = t.e * pixelRatio;
|
|
433
|
+
to.f = t.f * pixelRatio;
|
|
434
|
+
},
|
|
426
435
|
scaleOfOuter(t, origin, scaleX, scaleY) {
|
|
427
436
|
M$a.toInnerPoint(t, origin, tempPoint$4);
|
|
428
437
|
M$a.scaleOfInner(t, tempPoint$4, scaleX, scaleY);
|
|
@@ -922,6 +931,10 @@ class Matrix {
|
|
|
922
931
|
this.scaleY *= y || x;
|
|
923
932
|
return this;
|
|
924
933
|
}
|
|
934
|
+
pixelScale(pixelRatio) {
|
|
935
|
+
MatrixHelper.pixelScale(this, pixelRatio);
|
|
936
|
+
return this;
|
|
937
|
+
}
|
|
925
938
|
scaleOfOuter(origin, x, y) {
|
|
926
939
|
MatrixHelper.scaleOfOuter(this, origin, x, y);
|
|
927
940
|
return this;
|
|
@@ -2146,7 +2159,7 @@ __decorate([ contextMethod() ], Canvas$1.prototype, "measureText", null);
|
|
|
2146
2159
|
|
|
2147
2160
|
__decorate([ contextMethod() ], Canvas$1.prototype, "strokeText", null);
|
|
2148
2161
|
|
|
2149
|
-
const {copy: copy$b, multiplyParent: multiplyParent$4} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
|
|
2162
|
+
const {copy: copy$b, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
|
|
2150
2163
|
|
|
2151
2164
|
const minSize = {
|
|
2152
2165
|
width: 1,
|
|
@@ -2247,12 +2260,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2247
2260
|
setWorld(matrix, parentMatrix) {
|
|
2248
2261
|
const {pixelRatio: pixelRatio, pixelSnap: pixelSnap} = this, w = this.worldTransform;
|
|
2249
2262
|
if (parentMatrix) multiplyParent$4(matrix, parentMatrix, w);
|
|
2250
|
-
|
|
2251
|
-
w.b = matrix.b * pixelRatio;
|
|
2252
|
-
w.c = matrix.c * pixelRatio;
|
|
2253
|
-
w.d = matrix.d * pixelRatio;
|
|
2254
|
-
w.e = matrix.e * pixelRatio;
|
|
2255
|
-
w.f = matrix.f * pixelRatio;
|
|
2263
|
+
pixelScale(matrix, pixelRatio, w);
|
|
2256
2264
|
if (pixelSnap) {
|
|
2257
2265
|
if (matrix.half && matrix.half * pixelRatio % 2) w.e = round$4(w.e - .5) + .5, w.f = round$4(w.f - .5) + .5; else w.e = round$4(w.e),
|
|
2258
2266
|
w.f = round$4(w.f);
|
|
@@ -4265,6 +4273,18 @@ function surfaceType(defaultValue) {
|
|
|
4265
4273
|
}));
|
|
4266
4274
|
}
|
|
4267
4275
|
|
|
4276
|
+
function dimType(defaultValue) {
|
|
4277
|
+
return decorateLeafAttr(defaultValue, key => attr({
|
|
4278
|
+
set(value) {
|
|
4279
|
+
if (this.__setAttr(key, value)) {
|
|
4280
|
+
const data = this.__;
|
|
4281
|
+
DataHelper.stintSet(data, "__useDim", data.dim || data.bright || data.dimskip);
|
|
4282
|
+
this.__layout.surfaceChange();
|
|
4283
|
+
}
|
|
4284
|
+
}
|
|
4285
|
+
}));
|
|
4286
|
+
}
|
|
4287
|
+
|
|
4268
4288
|
function opacityType(defaultValue) {
|
|
4269
4289
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4270
4290
|
set(value) {
|
|
@@ -4309,7 +4329,7 @@ function sortType(defaultValue) {
|
|
|
4309
4329
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4310
4330
|
set(value) {
|
|
4311
4331
|
if (this.__setAttr(key, value)) {
|
|
4312
|
-
this.__layout.
|
|
4332
|
+
this.__layout.surfaceChange();
|
|
4313
4333
|
this.waitParent(() => {
|
|
4314
4334
|
this.parent.__layout.childrenSortChange();
|
|
4315
4335
|
});
|
|
@@ -4346,7 +4366,7 @@ function hitType(defaultValue) {
|
|
|
4346
4366
|
set(value) {
|
|
4347
4367
|
if (this.__setAttr(key, value)) {
|
|
4348
4368
|
this.__layout.hitCanvasChanged = true;
|
|
4349
|
-
if (Debug.showBounds === "hit") this.__layout.
|
|
4369
|
+
if (Debug.showBounds === "hit") this.__layout.surfaceChange();
|
|
4350
4370
|
if (this.leafer) this.leafer.updateCursor();
|
|
4351
4371
|
}
|
|
4352
4372
|
}
|
|
@@ -5861,6 +5881,7 @@ const LeafRender = {
|
|
|
5861
5881
|
if (options.shape) return this.__renderShape(canvas, options);
|
|
5862
5882
|
if (this.__worldOpacity) {
|
|
5863
5883
|
const data = this.__;
|
|
5884
|
+
if (data.bright && !options.topRendering) return options.topList.add(this);
|
|
5864
5885
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
5865
5886
|
canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
|
|
5866
5887
|
if (this.__.__single) {
|
|
@@ -5909,7 +5930,9 @@ const BranchRender = {
|
|
|
5909
5930
|
this.__nowWorld = this.__getNowWorld(options);
|
|
5910
5931
|
if (this.__worldOpacity) {
|
|
5911
5932
|
const data = this.__;
|
|
5912
|
-
if (data.
|
|
5933
|
+
if (data.__useDim) {
|
|
5934
|
+
if (data.dim) options.dimOpacity = data.dim === true ? .2 : data.dim; else if (data.bright && !options.topRendering) return options.topList.add(this); else if (data.dimskip) options.dimOpacity && (options.dimOpacity = 0);
|
|
5935
|
+
}
|
|
5913
5936
|
if (data.__single && !this.isBranchLeaf) {
|
|
5914
5937
|
if (data.eraser === "path") return this.__renderEraser(canvas, options);
|
|
5915
5938
|
const tempCanvas = canvas.getSameCanvas(false, true);
|
|
@@ -6751,7 +6774,7 @@ class LeafLevelList {
|
|
|
6751
6774
|
}
|
|
6752
6775
|
}
|
|
6753
6776
|
|
|
6754
|
-
const version = "1.9.
|
|
6777
|
+
const version = "1.9.7";
|
|
6755
6778
|
|
|
6756
6779
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6757
6780
|
get allowBackgroundColor() {
|
|
@@ -7305,7 +7328,7 @@ class Renderer {
|
|
|
7305
7328
|
};
|
|
7306
7329
|
if (this.needFill) canvas.fillWorld(bounds, this.config.fill);
|
|
7307
7330
|
if (Debug.showRepaint) Debug.drawRepaint(canvas, bounds);
|
|
7308
|
-
this.target
|
|
7331
|
+
Platform.render(this.target, canvas, options);
|
|
7309
7332
|
this.renderBounds = realBounds = realBounds || bounds;
|
|
7310
7333
|
this.renderOptions = options;
|
|
7311
7334
|
this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
|
|
@@ -7581,6 +7604,15 @@ Object.assign(Creator, {
|
|
|
7581
7604
|
|
|
7582
7605
|
Platform.layout = Layouter.fullLayout;
|
|
7583
7606
|
|
|
7607
|
+
Platform.render = function(target, canvas, options) {
|
|
7608
|
+
const topOptions = Object.assign(Object.assign({}, options), {
|
|
7609
|
+
topRendering: true
|
|
7610
|
+
});
|
|
7611
|
+
options.topList = new LeafList;
|
|
7612
|
+
target.__render(canvas, options);
|
|
7613
|
+
if (options.topList.length) options.topList.forEach(item => item.__render(canvas, topOptions));
|
|
7614
|
+
};
|
|
7615
|
+
|
|
7584
7616
|
function effectType(defaultValue) {
|
|
7585
7617
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
7586
7618
|
set(value) {
|
|
@@ -8356,9 +8388,9 @@ __decorate([ visibleType(true) ], UI.prototype, "visible", void 0);
|
|
|
8356
8388
|
|
|
8357
8389
|
__decorate([ surfaceType(false) ], UI.prototype, "locked", void 0);
|
|
8358
8390
|
|
|
8359
|
-
__decorate([
|
|
8391
|
+
__decorate([ dimType(false) ], UI.prototype, "dim", void 0);
|
|
8360
8392
|
|
|
8361
|
-
__decorate([
|
|
8393
|
+
__decorate([ dimType(false) ], UI.prototype, "dimskip", void 0);
|
|
8362
8394
|
|
|
8363
8395
|
__decorate([ sortType(0) ], UI.prototype, "zIndex", void 0);
|
|
8364
8396
|
|
|
@@ -12621,12 +12653,15 @@ function targetAttr(fn) {
|
|
|
12621
12653
|
set(value) {
|
|
12622
12654
|
const old = this[privateKey];
|
|
12623
12655
|
if (old !== value) {
|
|
12624
|
-
|
|
12656
|
+
const t = this;
|
|
12657
|
+
if (t.config) {
|
|
12625
12658
|
const isSelect = key === "target";
|
|
12626
12659
|
if (isSelect) {
|
|
12660
|
+
t.setDimOthers(false);
|
|
12661
|
+
t.setBright(false);
|
|
12627
12662
|
if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
|
|
12628
|
-
if (
|
|
12629
|
-
const {beforeSelect: beforeSelect} =
|
|
12663
|
+
if (t.single) t.element.syncEventer = null;
|
|
12664
|
+
const {beforeSelect: beforeSelect} = t.config;
|
|
12630
12665
|
if (beforeSelect) {
|
|
12631
12666
|
const check = beforeSelect({
|
|
12632
12667
|
target: value
|
|
@@ -12636,7 +12671,7 @@ function targetAttr(fn) {
|
|
|
12636
12671
|
}
|
|
12637
12672
|
const type = isSelect ? EditorEvent.BEFORE_SELECT : EditorEvent.BEFORE_HOVER;
|
|
12638
12673
|
if (this.hasEvent(type)) this.emitEvent(new EditorEvent(type, {
|
|
12639
|
-
editor:
|
|
12674
|
+
editor: t,
|
|
12640
12675
|
value: value,
|
|
12641
12676
|
oldValue: old
|
|
12642
12677
|
}));
|
|
@@ -13307,13 +13342,18 @@ const cacheCursors = {};
|
|
|
13307
13342
|
function updatePointCursor(editBox, e) {
|
|
13308
13343
|
const {enterPoint: point, dragging: dragging, skewing: skewing, resizing: resizing, flippedX: flippedX, flippedY: flippedY} = editBox;
|
|
13309
13344
|
if (!point || !editBox.editor.editing || !editBox.canUse) return;
|
|
13345
|
+
if (point.name === "rect") return updateMoveCursor(editBox);
|
|
13310
13346
|
if (point.name === "circle") return;
|
|
13311
|
-
|
|
13347
|
+
let {rotation: rotation} = editBox;
|
|
13348
|
+
const {pointType: pointType} = point, {moveCursor: moveCursor, resizeCursor: resizeCursor, rotateCursor: rotateCursor, skewCursor: skewCursor, moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = editBox.mergeConfig;
|
|
13349
|
+
if (pointType === "move") {
|
|
13350
|
+
point.cursor = moveCursor;
|
|
13351
|
+
if (!moveable) point.visible = false;
|
|
13352
|
+
return;
|
|
13353
|
+
} else if (pointType === "button") {
|
|
13312
13354
|
if (!point.cursor) point.cursor = "pointer";
|
|
13313
13355
|
return;
|
|
13314
13356
|
}
|
|
13315
|
-
let {rotation: rotation} = editBox;
|
|
13316
|
-
const {pointType: pointType} = point, {resizeCursor: resizeCursor, rotateCursor: rotateCursor, skewCursor: skewCursor, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = editBox.mergeConfig;
|
|
13317
13357
|
let showResize = pointType.includes("resize");
|
|
13318
13358
|
if (showResize && rotateable && (editBox.isHoldRotateKey(e) || !resizeable)) showResize = false;
|
|
13319
13359
|
const showSkew = skewable && !showResize && (point.name === "resize-line" || pointType === "skew");
|
|
@@ -13394,7 +13434,7 @@ class EditBox extends Group {
|
|
|
13394
13434
|
constructor(editor) {
|
|
13395
13435
|
super();
|
|
13396
13436
|
this.view = new Group;
|
|
13397
|
-
this.rect = new
|
|
13437
|
+
this.rect = new EditPoint({
|
|
13398
13438
|
name: "rect",
|
|
13399
13439
|
hitFill: "all",
|
|
13400
13440
|
hitStroke: "none",
|
|
@@ -13456,12 +13496,13 @@ class EditBox extends Group {
|
|
|
13456
13496
|
this.listenPointEvents(resizePoint, "resize", i);
|
|
13457
13497
|
}
|
|
13458
13498
|
this.listenPointEvents(circle, "rotate", 2);
|
|
13499
|
+
this.listenPointEvents(rect, "move", 8);
|
|
13459
13500
|
view.addMany(...rotatePoints, rect, circle, buttons, ...resizeLines, ...resizePoints);
|
|
13460
13501
|
this.add(view);
|
|
13461
13502
|
}
|
|
13462
13503
|
load() {
|
|
13463
|
-
const {target: target, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, resizePoints: resizePoints} = this;
|
|
13464
|
-
const {stroke: stroke, strokeWidth: strokeWidth} = mergeConfig;
|
|
13504
|
+
const {target: target, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, resizePoints: resizePoints, resizeLines: resizeLines} = this;
|
|
13505
|
+
const {stroke: stroke, strokeWidth: strokeWidth, resizeLine: resizeLine} = mergeConfig;
|
|
13465
13506
|
const pointsStyle = this.getPointsStyle();
|
|
13466
13507
|
const middlePointsStyle = this.getMiddlePointsStyle();
|
|
13467
13508
|
this.visible = !target.locked;
|
|
@@ -13470,6 +13511,10 @@ class EditBox extends Group {
|
|
|
13470
13511
|
resizeP = resizePoints[i];
|
|
13471
13512
|
resizeP.set(this.getPointStyle(i % 2 ? middlePointsStyle[(i - 1) / 2 % middlePointsStyle.length] : pointsStyle[i / 2 % pointsStyle.length]));
|
|
13472
13513
|
resizeP.rotation = (i - (i % 2 ? 1 : 0)) / 2 * 90;
|
|
13514
|
+
if (i % 2) resizeLines[(i - 1) / 2].set(Object.assign({
|
|
13515
|
+
pointType: "resize",
|
|
13516
|
+
rotation: (i - 1) / 2 * 90
|
|
13517
|
+
}, resizeLine || {}));
|
|
13473
13518
|
}
|
|
13474
13519
|
circle.set(this.getPointStyle(mergeConfig.circle || mergeConfig.rotatePoint || pointsStyle[0]));
|
|
13475
13520
|
rect.set(Object.assign({
|
|
@@ -13514,10 +13559,12 @@ class EditBox extends Group {
|
|
|
13514
13559
|
if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
|
|
13515
13560
|
}
|
|
13516
13561
|
updateBounds(bounds) {
|
|
13517
|
-
const {
|
|
13518
|
-
const {
|
|
13519
|
-
const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
|
|
13562
|
+
const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
|
|
13563
|
+
const {editMask: editMask} = editor;
|
|
13564
|
+
const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
|
|
13520
13565
|
editMask.visible = mask ? true : 0;
|
|
13566
|
+
editor.setDimOthers(dimOthers);
|
|
13567
|
+
editor.setBright(!!dimOthers || bright);
|
|
13521
13568
|
if (spread) BoundsHelper.spread(bounds, spread);
|
|
13522
13569
|
if (this.view.worldOpacity) {
|
|
13523
13570
|
const {width: width, height: height} = bounds;
|
|
@@ -13538,10 +13585,10 @@ class EditBox extends Group {
|
|
|
13538
13585
|
resizeL.visible = resizeP.visible && !hideResizeLines;
|
|
13539
13586
|
resizeP.visible = rotateP.visible = showPoints && !!middlePoint;
|
|
13540
13587
|
if ((i + 1) / 2 % 2) {
|
|
13541
|
-
resizeL.width = width;
|
|
13588
|
+
resizeL.width = width + resizeL.height;
|
|
13542
13589
|
if (hideOnSmall && resizeP.width * 2 > width) resizeP.visible = false;
|
|
13543
13590
|
} else {
|
|
13544
|
-
resizeL.
|
|
13591
|
+
resizeL.width = height + resizeL.height;
|
|
13545
13592
|
if (hideOnSmall && resizeP.width * 2 > height) resizeP.visible = false;
|
|
13546
13593
|
}
|
|
13547
13594
|
}
|
|
@@ -13618,7 +13665,7 @@ class EditBox extends Group {
|
|
|
13618
13665
|
this.dragging = true;
|
|
13619
13666
|
const point = this.dragPoint = e.current, {pointType: pointType} = point;
|
|
13620
13667
|
const {editor: editor, dragStartData: dragStartData} = this, {target: target} = this, {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, hideOnMove: hideOnMove} = this.mergeConfig;
|
|
13621
|
-
if (
|
|
13668
|
+
if (pointType === "move") {
|
|
13622
13669
|
moveable && (this.moving = true);
|
|
13623
13670
|
editor.opacity = hideOnMove ? 0 : 1;
|
|
13624
13671
|
} else {
|
|
@@ -13643,23 +13690,22 @@ class EditBox extends Group {
|
|
|
13643
13690
|
if (this.moving && this.mergeConfig.dragLimitAnimate && this.target.dragBounds) this.transformTool.onMove(e);
|
|
13644
13691
|
this.dragPoint = null;
|
|
13645
13692
|
this.resetDoing();
|
|
13646
|
-
const {
|
|
13647
|
-
if (
|
|
13693
|
+
const {pointType: pointType} = e.current;
|
|
13694
|
+
if (pointType === "move") this.editor.opacity = 1;
|
|
13648
13695
|
if (pointType && pointType.includes("resize")) ResizeEvent.resizingKeys = null;
|
|
13649
13696
|
}
|
|
13650
13697
|
onDrag(e) {
|
|
13651
13698
|
const {transformTool: transformTool, moving: moving, resizing: resizing, rotating: rotating, skewing: skewing} = this;
|
|
13652
13699
|
if (moving) {
|
|
13653
13700
|
transformTool.onMove(e);
|
|
13654
|
-
updateMoveCursor(this);
|
|
13655
13701
|
} else if (resizing || rotating || skewing) {
|
|
13656
13702
|
const point = e.current;
|
|
13657
13703
|
if (point.pointType) this.enterPoint = point;
|
|
13658
13704
|
if (rotating) transformTool.onRotate(e);
|
|
13659
13705
|
if (resizing) transformTool.onScale(e);
|
|
13660
13706
|
if (skewing) transformTool.onSkew(e);
|
|
13661
|
-
updatePointCursor(this, e);
|
|
13662
13707
|
}
|
|
13708
|
+
updatePointCursor(this, e);
|
|
13663
13709
|
}
|
|
13664
13710
|
resetDoing() {
|
|
13665
13711
|
if (this.canUse) this.dragging = this.gesturing = this.moving = this.resizing = this.rotating = this.skewing = false;
|
|
@@ -13755,17 +13801,15 @@ class EditBox extends Group {
|
|
|
13755
13801
|
listenPointEvents(point, type, direction) {
|
|
13756
13802
|
point.direction = direction;
|
|
13757
13803
|
point.pointType = type;
|
|
13758
|
-
|
|
13759
|
-
this.enterPoint = null;
|
|
13760
|
-
} ] ];
|
|
13761
|
-
if (point.name !== "circle") events.push([ PointerEvent.ENTER, e => {
|
|
13804
|
+
this.__eventIds.push(point.on_([ [ DragEvent.START, this.onDragStart, this ], [ DragEvent.DRAG, this.onDrag, this ], [ DragEvent.END, this.onDragEnd, this ], [ PointerEvent.ENTER, e => {
|
|
13762
13805
|
this.enterPoint = point, updatePointCursor(this, e);
|
|
13763
|
-
} ])
|
|
13764
|
-
|
|
13806
|
+
} ], [ PointerEvent.LEAVE, () => {
|
|
13807
|
+
this.enterPoint = null;
|
|
13808
|
+
} ] ]));
|
|
13765
13809
|
}
|
|
13766
13810
|
__listenEvents() {
|
|
13767
13811
|
const {rect: rect, editor: editor, __eventIds: events} = this;
|
|
13768
|
-
events.push(rect.on_([ [
|
|
13812
|
+
events.push(rect.on_([ [ PointerEvent.DOUBLE_TAP, this.onDoubleTap, this ], [ PointerEvent.LONG_PRESS, this.onLongPress, this ] ]));
|
|
13769
13813
|
this.waitLeafer(() => {
|
|
13770
13814
|
events.push(editor.app.on_([ [ [ KeyEvent.HOLD, KeyEvent.UP ], this.onKey, this ], [ KeyEvent.DOWN, this.onArrow, this ], [ MoveEvent.BEFORE_MOVE, this.onMove, this, true ], [ ZoomEvent.BEFORE_ZOOM, this.onScale, this, true ], [ RotateEvent.BEFORE_ROTATE, this.onRotate, this, true ], [ MoveEvent.END, this.onMoveEnd, this ], [ ZoomEvent.END, this.resetDoing, this ], [ RotateEvent.END, this.resetDoing, this ] ]));
|
|
13771
13815
|
});
|
|
@@ -14493,6 +14537,16 @@ let Editor = class Editor extends Group {
|
|
|
14493
14537
|
shiftItem(item) {
|
|
14494
14538
|
this.hasItem(item) ? this.removeItem(item) : this.addItem(item);
|
|
14495
14539
|
}
|
|
14540
|
+
setDimOthers(value, attrName = "dim", list) {
|
|
14541
|
+
if (!list) {
|
|
14542
|
+
const {dimTarget: dimTarget, targetLeafer: targetLeafer} = this;
|
|
14543
|
+
list = dimTarget ? isArray(dimTarget) ? dimTarget : [ dimTarget ] : [ targetLeafer ];
|
|
14544
|
+
}
|
|
14545
|
+
if (list[0] && list[0][attrName] !== (value || false)) list.forEach(item => DataHelper.stintSet(item, attrName, value));
|
|
14546
|
+
}
|
|
14547
|
+
setBright(value) {
|
|
14548
|
+
this.setDimOthers(value, "bright", this.list);
|
|
14549
|
+
}
|
|
14496
14550
|
update() {
|
|
14497
14551
|
if (this.editing) {
|
|
14498
14552
|
if (!this.element.parent) return this.cancel();
|
|
@@ -14715,10 +14769,10 @@ let Editor = class Editor extends Group {
|
|
|
14715
14769
|
|
|
14716
14770
|
__decorate([ mergeConfigAttr() ], Editor.prototype, "mergeConfig", void 0);
|
|
14717
14771
|
|
|
14718
|
-
__decorate([ targetAttr(onHover) ], Editor.prototype, "hoverTarget", void 0);
|
|
14719
|
-
|
|
14720
14772
|
__decorate([ targetAttr(onTarget) ], Editor.prototype, "target", void 0);
|
|
14721
14773
|
|
|
14774
|
+
__decorate([ targetAttr(onHover) ], Editor.prototype, "hoverTarget", void 0);
|
|
14775
|
+
|
|
14722
14776
|
Editor = __decorate([ useModule(TransformTool, [ "editBox", "editTool", "emitEvent" ]) ], Editor);
|
|
14723
14777
|
|
|
14724
14778
|
class InnerEditor {
|
|
@@ -19228,14 +19282,10 @@ const ExportModule = {
|
|
|
19228
19282
|
renderOptions.bounds = canvas.bounds;
|
|
19229
19283
|
}
|
|
19230
19284
|
canvas.save();
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
leaf.fill = oldFill;
|
|
19236
|
-
} else {
|
|
19237
|
-
leaf.__render(canvas, renderOptions);
|
|
19238
|
-
}
|
|
19285
|
+
const igroneFill = isFrame && !isUndefined(fill), oldFill = leaf.get("fill");
|
|
19286
|
+
if (igroneFill) leaf.fill = "";
|
|
19287
|
+
Platform.render(leaf, canvas, renderOptions);
|
|
19288
|
+
if (igroneFill) leaf.fill = oldFill;
|
|
19239
19289
|
canvas.restore();
|
|
19240
19290
|
if (sliceLeaf) sliceLeaf.__updateWorldOpacity();
|
|
19241
19291
|
if (trim) {
|
|
@@ -19397,4 +19447,8 @@ Object.assign(Filter, {
|
|
|
19397
19447
|
}
|
|
19398
19448
|
});
|
|
19399
19449
|
|
|
19400
|
-
|
|
19450
|
+
Plugin.add("bright");
|
|
19451
|
+
|
|
19452
|
+
UI.addAttr("bright", false, dimType);
|
|
19453
|
+
|
|
19454
|
+
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, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, 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, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, 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, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, 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, 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$1 as tempBounds, tempMatrix$1 as tempMatrix, tempPoint$3 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|