@leafer-editor/worker 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/worker.cjs +0 -1
- package/dist/worker.esm.js +0 -1
- package/dist/worker.js +127 -80
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +123 -80
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +15 -15
- package/dist/worker.cjs.map +0 -1
- package/dist/worker.esm.js.map +0 -1
- package/dist/worker.js.map +0 -1
- package/dist/worker.module.js.map +0 -1
package/dist/worker.module.js
CHANGED
|
@@ -2589,7 +2589,11 @@ const BezierHelper = {
|
|
|
2589
2589
|
const point = {};
|
|
2590
2590
|
getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, point);
|
|
2591
2591
|
return point;
|
|
2592
|
-
}
|
|
2592
|
+
},
|
|
2593
|
+
getDerivative(t, fromV, v1, v2, toV) {
|
|
2594
|
+
const o = 1 - t;
|
|
2595
|
+
return 3 * o * o * (v1 - fromV) + 6 * o * t * (v2 - v1) + 3 * t * t * (toV - v2);
|
|
2596
|
+
},
|
|
2593
2597
|
};
|
|
2594
2598
|
const { getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$6 } = BezierHelper;
|
|
2595
2599
|
|
|
@@ -3770,8 +3774,11 @@ class LeaferImage {
|
|
|
3770
3774
|
load(onSuccess, onError) {
|
|
3771
3775
|
if (!this.loading) {
|
|
3772
3776
|
this.loading = true;
|
|
3777
|
+
let { loadImage, loadImageWithProgress } = Platform.origin, onProgress = this.config.showProgress && loadImageWithProgress && this.onProgress.bind(this);
|
|
3778
|
+
if (onProgress)
|
|
3779
|
+
loadImage = loadImageWithProgress;
|
|
3773
3780
|
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
3774
|
-
return yield
|
|
3781
|
+
return yield loadImage(this.url, onProgress).then(img => this.setView(img)).catch((e) => {
|
|
3775
3782
|
this.error = e;
|
|
3776
3783
|
this.onComplete(false);
|
|
3777
3784
|
});
|
|
@@ -3796,6 +3803,9 @@ class LeaferImage {
|
|
|
3796
3803
|
this.view = img;
|
|
3797
3804
|
this.onComplete(true);
|
|
3798
3805
|
}
|
|
3806
|
+
onProgress(progress) {
|
|
3807
|
+
this.progress = progress;
|
|
3808
|
+
}
|
|
3799
3809
|
onComplete(isSuccess) {
|
|
3800
3810
|
let odd;
|
|
3801
3811
|
this.waitComplete.forEach((item, index) => {
|
|
@@ -4261,13 +4271,20 @@ const LeafHelper = {
|
|
|
4261
4271
|
if (leaf.isBranch) {
|
|
4262
4272
|
const { children } = leaf;
|
|
4263
4273
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
4264
|
-
updateAllWorldOpacity
|
|
4274
|
+
updateAllWorldOpacity(children[i]);
|
|
4265
4275
|
}
|
|
4266
4276
|
}
|
|
4267
4277
|
},
|
|
4268
|
-
|
|
4269
|
-
|
|
4278
|
+
updateChange(leaf) {
|
|
4279
|
+
const layout = leaf.__layout;
|
|
4280
|
+
if (layout.stateStyleChanged)
|
|
4281
|
+
leaf.updateState();
|
|
4282
|
+
if (layout.opacityChanged)
|
|
4283
|
+
updateAllWorldOpacity(leaf);
|
|
4270
4284
|
leaf.__updateChange();
|
|
4285
|
+
},
|
|
4286
|
+
updateAllChange(leaf) {
|
|
4287
|
+
updateChange$1(leaf);
|
|
4271
4288
|
if (leaf.isBranch) {
|
|
4272
4289
|
const { children } = leaf;
|
|
4273
4290
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
@@ -4403,7 +4420,7 @@ const LeafHelper = {
|
|
|
4403
4420
|
}
|
|
4404
4421
|
};
|
|
4405
4422
|
const L$3 = LeafHelper;
|
|
4406
|
-
const { updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$3, updateAllWorldOpacity:
|
|
4423
|
+
const { updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$3, updateAllWorldOpacity, updateAllChange: updateAllChange$1, updateChange: updateChange$1 } = L$3;
|
|
4407
4424
|
function getTempLocal(t, world) {
|
|
4408
4425
|
t.__layout.update();
|
|
4409
4426
|
return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
|
|
@@ -6125,7 +6142,7 @@ class LeafLevelList {
|
|
|
6125
6142
|
}
|
|
6126
6143
|
}
|
|
6127
6144
|
|
|
6128
|
-
const version = "1.6.
|
|
6145
|
+
const version = "1.6.2";
|
|
6129
6146
|
|
|
6130
6147
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6131
6148
|
get allowBackgroundColor() { return true; }
|
|
@@ -6310,7 +6327,7 @@ class Watcher {
|
|
|
6310
6327
|
}
|
|
6311
6328
|
}
|
|
6312
6329
|
|
|
6313
|
-
const { updateAllMatrix: updateAllMatrix$1, updateBounds: updateOneBounds,
|
|
6330
|
+
const { updateAllMatrix: updateAllMatrix$1, updateBounds: updateOneBounds, updateChange: updateOneChange } = LeafHelper;
|
|
6314
6331
|
const { pushAllChildBranch, pushAllParent } = BranchHelper;
|
|
6315
6332
|
function updateMatrix$1(updateList, levelList) {
|
|
6316
6333
|
let layout;
|
|
@@ -6353,15 +6370,7 @@ function updateBounds(boundsList) {
|
|
|
6353
6370
|
});
|
|
6354
6371
|
}
|
|
6355
6372
|
function updateChange(updateList) {
|
|
6356
|
-
|
|
6357
|
-
updateList.list.forEach(leaf => {
|
|
6358
|
-
layout = leaf.__layout;
|
|
6359
|
-
if (layout.opacityChanged)
|
|
6360
|
-
updateAllWorldOpacity(leaf);
|
|
6361
|
-
if (layout.stateStyleChanged)
|
|
6362
|
-
setTimeout(() => layout.stateStyleChanged && leaf.updateState());
|
|
6363
|
-
leaf.__updateChange();
|
|
6364
|
-
});
|
|
6373
|
+
updateList.list.forEach(updateOneChange);
|
|
6365
6374
|
}
|
|
6366
6375
|
|
|
6367
6376
|
const { worldBounds: worldBounds$1 } = LeafBoundsHelper;
|
|
@@ -6582,6 +6591,15 @@ class Renderer {
|
|
|
6582
6591
|
}
|
|
6583
6592
|
checkRender() {
|
|
6584
6593
|
if (this.running) {
|
|
6594
|
+
const { target } = this;
|
|
6595
|
+
if (target.isApp) {
|
|
6596
|
+
target.emit(RenderEvent.CHILD_START, target);
|
|
6597
|
+
target.children.forEach(leafer => {
|
|
6598
|
+
leafer.renderer.FPS = this.FPS;
|
|
6599
|
+
leafer.renderer.checkRender();
|
|
6600
|
+
});
|
|
6601
|
+
target.emit(RenderEvent.CHILD_END, target);
|
|
6602
|
+
}
|
|
6585
6603
|
if (this.changed && this.canvas.view)
|
|
6586
6604
|
this.render();
|
|
6587
6605
|
this.target.emit(RenderEvent.NEXT);
|
|
@@ -6667,7 +6685,7 @@ class Renderer {
|
|
|
6667
6685
|
bounds.spread(Renderer.clipSpread).ceil();
|
|
6668
6686
|
canvas.clearWorld(bounds, true);
|
|
6669
6687
|
canvas.clipWorld(bounds, true);
|
|
6670
|
-
this.__render(bounds,
|
|
6688
|
+
this.__render(bounds, realBounds);
|
|
6671
6689
|
canvas.restore();
|
|
6672
6690
|
Run.end(t);
|
|
6673
6691
|
}
|
|
@@ -6676,12 +6694,12 @@ class Renderer {
|
|
|
6676
6694
|
const { canvas } = this;
|
|
6677
6695
|
canvas.save();
|
|
6678
6696
|
canvas.clear();
|
|
6679
|
-
this.__render(canvas.bounds
|
|
6697
|
+
this.__render(canvas.bounds);
|
|
6680
6698
|
canvas.restore();
|
|
6681
6699
|
Run.end(t);
|
|
6682
6700
|
}
|
|
6683
|
-
__render(bounds,
|
|
6684
|
-
const { canvas } = this, options = includes ? { includes } : { bounds, includes };
|
|
6701
|
+
__render(bounds, realBounds) {
|
|
6702
|
+
const { canvas } = this, includes = bounds.includes(this.target.__world), options = includes ? { includes } : { bounds, includes };
|
|
6685
6703
|
if (this.needFill)
|
|
6686
6704
|
canvas.fillWorld(bounds, this.config.fill);
|
|
6687
6705
|
if (Debug.showRepaint)
|
|
@@ -6708,22 +6726,14 @@ class Renderer {
|
|
|
6708
6726
|
}
|
|
6709
6727
|
__requestRender() {
|
|
6710
6728
|
const target = this.target;
|
|
6711
|
-
if (target
|
|
6712
|
-
return target.parentApp.renderer.update(false);
|
|
6713
|
-
if (this.requestTime)
|
|
6729
|
+
if (this.requestTime || !target)
|
|
6714
6730
|
return;
|
|
6731
|
+
if (target.parentApp)
|
|
6732
|
+
return target.parentApp.requestRender(false);
|
|
6715
6733
|
const requestTime = this.requestTime = Date.now();
|
|
6716
6734
|
Platform.requestRender(() => {
|
|
6717
6735
|
this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - requestTime)));
|
|
6718
6736
|
this.requestTime = 0;
|
|
6719
|
-
if (target.isApp) {
|
|
6720
|
-
target.emit(RenderEvent.CHILD_START, target);
|
|
6721
|
-
target.children.forEach(leafer => {
|
|
6722
|
-
leafer.renderer.FPS = this.FPS;
|
|
6723
|
-
leafer.renderer.checkRender();
|
|
6724
|
-
});
|
|
6725
|
-
target.emit(RenderEvent.CHILD_END, target);
|
|
6726
|
-
}
|
|
6727
6737
|
this.checkRender();
|
|
6728
6738
|
});
|
|
6729
6739
|
}
|
|
@@ -7205,13 +7215,11 @@ class TextData extends UIData {
|
|
|
7205
7215
|
setFontWeight(value) {
|
|
7206
7216
|
if (typeof value === 'string') {
|
|
7207
7217
|
this.__setInput('fontWeight', value);
|
|
7208
|
-
|
|
7209
|
-
}
|
|
7210
|
-
else {
|
|
7211
|
-
if (this.__input)
|
|
7212
|
-
this.__removeInput('fontWeight');
|
|
7213
|
-
this._fontWeight = value;
|
|
7218
|
+
value = fontWeightMap[value] || 400;
|
|
7214
7219
|
}
|
|
7220
|
+
else if (this.__input)
|
|
7221
|
+
this.__removeInput('fontWeight');
|
|
7222
|
+
this._fontWeight = value;
|
|
7215
7223
|
}
|
|
7216
7224
|
setBoxStyle(value) {
|
|
7217
7225
|
let t = this.__leaf, box = t.__box;
|
|
@@ -7538,6 +7546,9 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7538
7546
|
else
|
|
7539
7547
|
drawer.rect(x, y, width, height);
|
|
7540
7548
|
}
|
|
7549
|
+
drawImagePlaceholder(canvas, _image) {
|
|
7550
|
+
Paint.fill(this.__.placeholderColor, this, canvas);
|
|
7551
|
+
}
|
|
7541
7552
|
animate(_keyframe, _options, _type, _isTemp) {
|
|
7542
7553
|
return Plugin.need('animate');
|
|
7543
7554
|
}
|
|
@@ -7774,6 +7785,9 @@ __decorate([
|
|
|
7774
7785
|
__decorate([
|
|
7775
7786
|
effectType()
|
|
7776
7787
|
], UI.prototype, "filter", void 0);
|
|
7788
|
+
__decorate([
|
|
7789
|
+
surfaceType()
|
|
7790
|
+
], UI.prototype, "placeholderColor", void 0);
|
|
7777
7791
|
__decorate([
|
|
7778
7792
|
dataType({})
|
|
7779
7793
|
], UI.prototype, "data", void 0);
|
|
@@ -8604,10 +8618,11 @@ let Image = class Image extends Rect {
|
|
|
8604
8618
|
get ready() { return this.image ? this.image.ready : false; }
|
|
8605
8619
|
constructor(data) {
|
|
8606
8620
|
super(data);
|
|
8607
|
-
this.
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8621
|
+
this.on_(ImageEvent.LOADED, this.__onLoaded, this);
|
|
8622
|
+
}
|
|
8623
|
+
__onLoaded(e) {
|
|
8624
|
+
if (e.attrName === 'fill' && e.attrValue.url === this.url)
|
|
8625
|
+
this.image = e.image;
|
|
8611
8626
|
}
|
|
8612
8627
|
destroy() {
|
|
8613
8628
|
this.image = null;
|
|
@@ -8721,7 +8736,7 @@ let Text = class Text extends UI {
|
|
|
8721
8736
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * 0.7) / 2;
|
|
8722
8737
|
data.__font = `${italic ? 'italic ' : ''}${textCase === 'small-caps' ? 'small-caps ' : ''}${fontWeight !== 'normal' ? fontWeight + ' ' : ''}${fontSize}px ${fontFamily}`;
|
|
8723
8738
|
data.__clipText = textOverflow !== 'show' && !data.__autoSize;
|
|
8724
|
-
data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
|
|
8739
|
+
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === '') ? data.placeholder : data.text, this.__);
|
|
8725
8740
|
}
|
|
8726
8741
|
__updateBoxBounds() {
|
|
8727
8742
|
const data = this.__;
|
|
@@ -8819,6 +8834,9 @@ __decorate([
|
|
|
8819
8834
|
__decorate([
|
|
8820
8835
|
boundsType('')
|
|
8821
8836
|
], Text.prototype, "text", void 0);
|
|
8837
|
+
__decorate([
|
|
8838
|
+
boundsType('')
|
|
8839
|
+
], Text.prototype, "placeholder", void 0);
|
|
8822
8840
|
__decorate([
|
|
8823
8841
|
boundsType('caption')
|
|
8824
8842
|
], Text.prototype, "fontFamily", void 0);
|
|
@@ -9694,8 +9712,7 @@ class InteractionBase {
|
|
|
9694
9712
|
if (this.downData) {
|
|
9695
9713
|
const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
|
|
9696
9714
|
if (canDrag) {
|
|
9697
|
-
|
|
9698
|
-
this.pointerWaitCancel();
|
|
9715
|
+
this.pointerWaitCancel();
|
|
9699
9716
|
this.waitRightTap = false;
|
|
9700
9717
|
}
|
|
9701
9718
|
this.dragger.checkDrag(data, canDrag);
|
|
@@ -9977,9 +9994,11 @@ class InteractionBase {
|
|
|
9977
9994
|
this.waitTap = true;
|
|
9978
9995
|
}
|
|
9979
9996
|
tapWaitCancel() {
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9997
|
+
if (this.waitTap) {
|
|
9998
|
+
clearTimeout(this.tapTimer);
|
|
9999
|
+
this.waitTap = false;
|
|
10000
|
+
this.tapCount = 0;
|
|
10001
|
+
}
|
|
9983
10002
|
}
|
|
9984
10003
|
longPressWait(data) {
|
|
9985
10004
|
clearTimeout(this.longPressTimer);
|
|
@@ -9999,8 +10018,10 @@ class InteractionBase {
|
|
|
9999
10018
|
return hasLong;
|
|
10000
10019
|
}
|
|
10001
10020
|
longPressWaitCancel() {
|
|
10002
|
-
|
|
10003
|
-
|
|
10021
|
+
if (this.longPressTimer) {
|
|
10022
|
+
clearTimeout(this.longPressTimer);
|
|
10023
|
+
this.longPressed = false;
|
|
10024
|
+
}
|
|
10004
10025
|
}
|
|
10005
10026
|
__onResize() {
|
|
10006
10027
|
const { dragOut } = this.m;
|
|
@@ -10241,8 +10262,10 @@ canvas$1.hitPixel = function (radiusPoint, offset, scale = 1) {
|
|
|
10241
10262
|
};
|
|
10242
10263
|
|
|
10243
10264
|
function fillText(ui, canvas) {
|
|
10244
|
-
|
|
10245
|
-
|
|
10265
|
+
const data = ui.__, { rows, decorationY } = data.__textDrawData;
|
|
10266
|
+
if (data.__isPlacehold && data.placeholderColor)
|
|
10267
|
+
canvas.fillStyle = data.placeholderColor;
|
|
10268
|
+
let row;
|
|
10246
10269
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10247
10270
|
row = rows[i];
|
|
10248
10271
|
if (row.text)
|
|
@@ -10251,7 +10274,7 @@ function fillText(ui, canvas) {
|
|
|
10251
10274
|
row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
|
|
10252
10275
|
}
|
|
10253
10276
|
if (decorationY) {
|
|
10254
|
-
const { decorationColor, decorationHeight } = data;
|
|
10277
|
+
const { decorationColor, decorationHeight } = data.__textDrawData;
|
|
10255
10278
|
if (decorationColor)
|
|
10256
10279
|
canvas.fillStyle = decorationColor;
|
|
10257
10280
|
rows.forEach(row => decorationY.forEach(value => canvas.fillRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
@@ -10260,38 +10283,44 @@ function fillText(ui, canvas) {
|
|
|
10260
10283
|
|
|
10261
10284
|
function fill(fill, ui, canvas) {
|
|
10262
10285
|
canvas.fillStyle = fill;
|
|
10263
|
-
|
|
10286
|
+
fillPathOrText(ui, canvas);
|
|
10264
10287
|
}
|
|
10265
10288
|
function fills(fills, ui, canvas) {
|
|
10266
10289
|
let item;
|
|
10267
|
-
const { windingRule, __font } = ui.__;
|
|
10268
10290
|
for (let i = 0, len = fills.length; i < len; i++) {
|
|
10269
10291
|
item = fills[i];
|
|
10270
|
-
if (item.image
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
if (item.blendMode)
|
|
10278
|
-
canvas.blendMode = item.blendMode;
|
|
10279
|
-
__font ? fillText(ui, canvas) : (windingRule ? canvas.fill(windingRule) : canvas.fill());
|
|
10280
|
-
canvas.restore();
|
|
10292
|
+
if (item.image) {
|
|
10293
|
+
if (PaintImage.checkImage(ui, canvas, item, !ui.__.__font))
|
|
10294
|
+
continue;
|
|
10295
|
+
if (!item.style) {
|
|
10296
|
+
if (!i && item.image.isPlacehold)
|
|
10297
|
+
ui.drawImagePlaceholder(canvas, item.image);
|
|
10298
|
+
continue;
|
|
10281
10299
|
}
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10300
|
+
}
|
|
10301
|
+
canvas.fillStyle = item.style;
|
|
10302
|
+
if (item.transform) {
|
|
10303
|
+
canvas.save();
|
|
10304
|
+
canvas.transform(item.transform);
|
|
10305
|
+
if (item.blendMode)
|
|
10306
|
+
canvas.blendMode = item.blendMode;
|
|
10307
|
+
fillPathOrText(ui, canvas);
|
|
10308
|
+
canvas.restore();
|
|
10309
|
+
}
|
|
10310
|
+
else {
|
|
10311
|
+
if (item.blendMode) {
|
|
10312
|
+
canvas.saveBlendMode(item.blendMode);
|
|
10313
|
+
fillPathOrText(ui, canvas);
|
|
10314
|
+
canvas.restoreBlendMode();
|
|
10291
10315
|
}
|
|
10316
|
+
else
|
|
10317
|
+
fillPathOrText(ui, canvas);
|
|
10292
10318
|
}
|
|
10293
10319
|
}
|
|
10294
10320
|
}
|
|
10321
|
+
function fillPathOrText(ui, canvas) {
|
|
10322
|
+
ui.__.__font ? fillText(ui, canvas) : (ui.__.windingRule ? canvas.fill(ui.__.windingRule) : canvas.fill());
|
|
10323
|
+
}
|
|
10295
10324
|
|
|
10296
10325
|
function strokeText(stroke, ui, canvas) {
|
|
10297
10326
|
const { strokeAlign } = ui.__;
|
|
@@ -10531,6 +10560,7 @@ const PaintModule = {
|
|
|
10531
10560
|
compute,
|
|
10532
10561
|
fill,
|
|
10533
10562
|
fills,
|
|
10563
|
+
fillPathOrText,
|
|
10534
10564
|
fillText,
|
|
10535
10565
|
stroke,
|
|
10536
10566
|
strokes,
|
|
@@ -10723,6 +10753,13 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
|
10723
10753
|
onLoadError(ui, event, error);
|
|
10724
10754
|
leafPaint.loadId = null;
|
|
10725
10755
|
});
|
|
10756
|
+
if (ui.placeholderColor)
|
|
10757
|
+
setTimeout(() => {
|
|
10758
|
+
if (!(image.ready || image.isPlacehold)) {
|
|
10759
|
+
image.isPlacehold = true;
|
|
10760
|
+
ui.forceUpdate('surface');
|
|
10761
|
+
}
|
|
10762
|
+
}, 100);
|
|
10726
10763
|
}
|
|
10727
10764
|
return leafPaint;
|
|
10728
10765
|
}
|
|
@@ -12276,8 +12313,10 @@ const EditDataHelper = {
|
|
|
12276
12313
|
align = 'top-right';
|
|
12277
12314
|
}
|
|
12278
12315
|
if (lockRatio) {
|
|
12279
|
-
|
|
12280
|
-
|
|
12316
|
+
if (lockRatio === 'corner' && direction % 2) {
|
|
12317
|
+
lockRatio = false;
|
|
12318
|
+
}
|
|
12319
|
+
else {
|
|
12281
12320
|
let scale;
|
|
12282
12321
|
switch (direction) {
|
|
12283
12322
|
case top$1:
|
|
@@ -14312,6 +14351,7 @@ interaction.multiTouch = function (data, list) {
|
|
|
14312
14351
|
return;
|
|
14313
14352
|
const { move, rotation, scale, center } = MultiTouchHelper.getData(list);
|
|
14314
14353
|
Object.assign(data, center);
|
|
14354
|
+
this.pointerWaitCancel();
|
|
14315
14355
|
this.rotate(getRotateEventData(rotation, data));
|
|
14316
14356
|
this.zoom(getZoomEventData(scale, data));
|
|
14317
14357
|
this.move(getMoveEventData(move, data));
|
|
@@ -15035,7 +15075,7 @@ const ExportModule = {
|
|
|
15035
15075
|
else {
|
|
15036
15076
|
let renderBounds, trimBounds, scaleX = 1, scaleY = 1;
|
|
15037
15077
|
const { worldTransform, isLeafer, leafer, isFrame } = leaf;
|
|
15038
|
-
const { slice, trim, padding, onCanvas } = options;
|
|
15078
|
+
const { slice, clip, trim, padding, onCanvas } = options;
|
|
15039
15079
|
const smooth = options.smooth === undefined ? (leafer ? leafer.config.smooth : true) : options.smooth;
|
|
15040
15080
|
const contextSettings = options.contextSettings || (leafer ? leafer.config.contextSettings : undefined);
|
|
15041
15081
|
const screenshot = options.screenshot || leaf.isApp;
|
|
@@ -15079,7 +15119,9 @@ const ExportModule = {
|
|
|
15079
15119
|
scaleData.scaleY *= pixelRatio;
|
|
15080
15120
|
pixelRatio = leaf.app.pixelRatio;
|
|
15081
15121
|
}
|
|
15082
|
-
|
|
15122
|
+
let { x, y, width, height } = new Bounds(renderBounds).scale(scaleData.scaleX, scaleData.scaleY);
|
|
15123
|
+
if (clip)
|
|
15124
|
+
x += clip.x, y += clip.y, width = clip.width, height = clip.height;
|
|
15083
15125
|
const renderOptions = { matrix: matrix.scale(1 / scaleData.scaleX, 1 / scaleData.scaleY).invert().translate(-x, -y).withScale(1 / scaleX * scaleData.scaleX, 1 / scaleY * scaleData.scaleY) };
|
|
15084
15126
|
let canvas = Creator.canvas({ width: Math.floor(width), height: Math.floor(height), pixelRatio, smooth, contextSettings });
|
|
15085
15127
|
let sliceLeaf;
|
|
@@ -15417,6 +15459,8 @@ let TextEditor = class TextEditor extends InnerEditor {
|
|
|
15417
15459
|
const { editTarget: text, editor, editDom: dom } = this;
|
|
15418
15460
|
if (text) {
|
|
15419
15461
|
this.onInput();
|
|
15462
|
+
if (text.text === '\n')
|
|
15463
|
+
text.text = '';
|
|
15420
15464
|
text.textEditing = undefined;
|
|
15421
15465
|
if (editor.app)
|
|
15422
15466
|
editor.app.config.keyEvent = this._keyEvent;
|
|
@@ -15500,4 +15544,3 @@ HTMLText = __decorate([
|
|
|
15500
15544
|
Plugin.add('html');
|
|
15501
15545
|
|
|
15502
15546
|
export { AlignHelper, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, 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, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, 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, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, 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, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isEmptyData, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
15503
|
-
//# sourceMappingURL=worker.module.js.map
|