leafer-ui 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/web.cjs +13 -32
- package/dist/web.esm.js +13 -32
- package/dist/web.js +78 -117
- package/dist/web.min.js +1 -1
- package/dist/web.module.js +78 -117
- package/dist/web.module.min.js +1 -1
- package/package.json +11 -11
package/dist/web.js
CHANGED
|
@@ -2961,7 +2961,6 @@ var LeaferUI = (function (exports) {
|
|
|
2961
2961
|
set path(value) { this.__path = value; }
|
|
2962
2962
|
get path() { return this.__path; }
|
|
2963
2963
|
constructor(path) {
|
|
2964
|
-
this.clearPath = this.beginPath;
|
|
2965
2964
|
this.set(path);
|
|
2966
2965
|
}
|
|
2967
2966
|
set(path) {
|
|
@@ -3043,6 +3042,9 @@ var LeaferUI = (function (exports) {
|
|
|
3043
3042
|
this.paint();
|
|
3044
3043
|
return this;
|
|
3045
3044
|
}
|
|
3045
|
+
clearPath() {
|
|
3046
|
+
return this.beginPath();
|
|
3047
|
+
}
|
|
3046
3048
|
paint() { }
|
|
3047
3049
|
}
|
|
3048
3050
|
|
|
@@ -3638,6 +3640,8 @@ var LeaferUI = (function (exports) {
|
|
|
3638
3640
|
else {
|
|
3639
3641
|
if (url.includes('.' + format) || url.includes('.' + FileHelper.upperCaseTypeMap[format]))
|
|
3640
3642
|
return true;
|
|
3643
|
+
else if (format === 'png' && !url.includes('.'))
|
|
3644
|
+
return true;
|
|
3641
3645
|
}
|
|
3642
3646
|
return false;
|
|
3643
3647
|
},
|
|
@@ -5255,7 +5259,7 @@ var LeaferUI = (function (exports) {
|
|
|
5255
5259
|
const { LEAF, create } = IncrementId;
|
|
5256
5260
|
const { toInnerPoint, toOuterPoint, multiplyParent } = MatrixHelper;
|
|
5257
5261
|
const { toOuterOf } = BoundsHelper;
|
|
5258
|
-
const { copy: copy$4, move
|
|
5262
|
+
const { copy: copy$4, move } = PointHelper;
|
|
5259
5263
|
const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal, moveWorld, zoomOfWorld, rotateOfWorld, skewOfWorld, transform, transformWorld, setTransform, getFlipTransform, getLocalOrigin, getRelativeWorld, drop } = LeafHelper;
|
|
5260
5264
|
exports.Leaf = class Leaf {
|
|
5261
5265
|
get tag() { return this.__tag; }
|
|
@@ -5490,7 +5494,7 @@ var LeaferUI = (function (exports) {
|
|
|
5490
5494
|
}
|
|
5491
5495
|
getBoxPointByInner(inner, _relative, _distance, change) {
|
|
5492
5496
|
const point = change ? inner : Object.assign({}, inner), { x, y } = this.boxBounds;
|
|
5493
|
-
move
|
|
5497
|
+
move(point, -x, -y);
|
|
5494
5498
|
return point;
|
|
5495
5499
|
}
|
|
5496
5500
|
getInnerPoint(world, relative, distance, change) {
|
|
@@ -5500,7 +5504,7 @@ var LeaferUI = (function (exports) {
|
|
|
5500
5504
|
}
|
|
5501
5505
|
getInnerPointByBox(box, _relative, _distance, change) {
|
|
5502
5506
|
const point = change ? box : Object.assign({}, box), { x, y } = this.boxBounds;
|
|
5503
|
-
move
|
|
5507
|
+
move(point, x, y);
|
|
5504
5508
|
return point;
|
|
5505
5509
|
}
|
|
5506
5510
|
getInnerPointByLocal(local, _relative, distance, change) {
|
|
@@ -5641,11 +5645,10 @@ var LeaferUI = (function (exports) {
|
|
|
5641
5645
|
}
|
|
5642
5646
|
destroy() {
|
|
5643
5647
|
if (!this.destroyed) {
|
|
5644
|
-
|
|
5645
|
-
if (parent)
|
|
5648
|
+
if (this.parent)
|
|
5646
5649
|
this.remove();
|
|
5647
5650
|
if (this.children)
|
|
5648
|
-
this.
|
|
5651
|
+
this.clear();
|
|
5649
5652
|
this.__emitLifeEvent(ChildEvent.DESTROY);
|
|
5650
5653
|
this.__.destroy();
|
|
5651
5654
|
this.__layout.destroy();
|
|
@@ -5959,7 +5962,7 @@ var LeaferUI = (function (exports) {
|
|
|
5959
5962
|
}
|
|
5960
5963
|
}
|
|
5961
5964
|
|
|
5962
|
-
const version = "1.0.
|
|
5965
|
+
const version = "1.0.8";
|
|
5963
5966
|
|
|
5964
5967
|
const debug$7 = Debug.get('LeaferCanvas');
|
|
5965
5968
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
@@ -7133,12 +7136,8 @@ var LeaferUI = (function (exports) {
|
|
|
7133
7136
|
};
|
|
7134
7137
|
const Transition = {
|
|
7135
7138
|
list: {},
|
|
7136
|
-
register(attrName, fn) {
|
|
7137
|
-
|
|
7138
|
-
},
|
|
7139
|
-
get(attrName) {
|
|
7140
|
-
return Transition.list[attrName];
|
|
7141
|
-
}
|
|
7139
|
+
register(attrName, fn) { Transition.list[attrName] = fn; },
|
|
7140
|
+
get(attrName) { return Transition.list[attrName]; }
|
|
7142
7141
|
};
|
|
7143
7142
|
|
|
7144
7143
|
const { parse, objectToCanvasData } = PathConvert;
|
|
@@ -7584,8 +7583,8 @@ var LeaferUI = (function (exports) {
|
|
|
7584
7583
|
pen.set(path = []), this.__drawPathByBox(pen);
|
|
7585
7584
|
return curve ? PathConvert.toCanvasData(path, true) : path;
|
|
7586
7585
|
}
|
|
7587
|
-
getPathString(curve, pathForRender) {
|
|
7588
|
-
return PathConvert.stringify(this.getPath(curve, pathForRender));
|
|
7586
|
+
getPathString(curve, pathForRender, floatLength) {
|
|
7587
|
+
return PathConvert.stringify(this.getPath(curve, pathForRender), floatLength);
|
|
7589
7588
|
}
|
|
7590
7589
|
load() {
|
|
7591
7590
|
this.__.__computePaint();
|
|
@@ -7994,11 +7993,11 @@ var LeaferUI = (function (exports) {
|
|
|
7994
7993
|
start() {
|
|
7995
7994
|
clearTimeout(this.__startTimer);
|
|
7996
7995
|
if (!this.running && this.canvas) {
|
|
7996
|
+
this.running = true;
|
|
7997
7997
|
this.ready ? this.emitLeafer(LeaferEvent.RESTART) : this.emitLeafer(LeaferEvent.START);
|
|
7998
7998
|
this.__controllers.forEach(item => item.start());
|
|
7999
7999
|
if (!this.isApp)
|
|
8000
8000
|
this.renderer.render();
|
|
8001
|
-
this.running = true;
|
|
8002
8001
|
}
|
|
8003
8002
|
}
|
|
8004
8003
|
stop() {
|
|
@@ -8104,12 +8103,10 @@ var LeaferUI = (function (exports) {
|
|
|
8104
8103
|
}
|
|
8105
8104
|
__changeFill(newValue) {
|
|
8106
8105
|
this.config.fill = newValue;
|
|
8107
|
-
if (this.canvas.allowBackgroundColor)
|
|
8106
|
+
if (this.canvas.allowBackgroundColor)
|
|
8108
8107
|
this.canvas.backgroundColor = newValue;
|
|
8109
|
-
|
|
8110
|
-
else {
|
|
8108
|
+
else
|
|
8111
8109
|
this.forceRender();
|
|
8112
|
-
}
|
|
8113
8110
|
}
|
|
8114
8111
|
__onCreated() {
|
|
8115
8112
|
this.created = true;
|
|
@@ -8176,13 +8173,10 @@ var LeaferUI = (function (exports) {
|
|
|
8176
8173
|
if (bind)
|
|
8177
8174
|
item = item.bind(bind);
|
|
8178
8175
|
this.__viewCompletedWait.push(item);
|
|
8179
|
-
if (this.viewCompleted)
|
|
8176
|
+
if (this.viewCompleted)
|
|
8180
8177
|
this.__checkViewCompleted(false);
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
if (!this.running)
|
|
8184
|
-
this.start();
|
|
8185
|
-
}
|
|
8178
|
+
else if (!this.running)
|
|
8179
|
+
this.start();
|
|
8186
8180
|
}
|
|
8187
8181
|
nextRender(item, bind, off) {
|
|
8188
8182
|
if (bind)
|
|
@@ -8196,9 +8190,8 @@ var LeaferUI = (function (exports) {
|
|
|
8196
8190
|
}
|
|
8197
8191
|
}
|
|
8198
8192
|
}
|
|
8199
|
-
else
|
|
8193
|
+
else
|
|
8200
8194
|
list.push(item);
|
|
8201
|
-
}
|
|
8202
8195
|
}
|
|
8203
8196
|
zoom(_zoomType, _padding, _fixedScale) {
|
|
8204
8197
|
return needPlugin('view');
|
|
@@ -8242,10 +8235,7 @@ var LeaferUI = (function (exports) {
|
|
|
8242
8235
|
this.stop();
|
|
8243
8236
|
this.emitEvent(new LeaferEvent(LeaferEvent.END, this));
|
|
8244
8237
|
this.__removeListenEvents();
|
|
8245
|
-
this.__controllers.forEach(item =>
|
|
8246
|
-
if (!(this.parent && item === this.interaction))
|
|
8247
|
-
item.destroy();
|
|
8248
|
-
});
|
|
8238
|
+
this.__controllers.forEach(item => !(this.parent && item === this.interaction) && item.destroy());
|
|
8249
8239
|
this.__controllers.length = 0;
|
|
8250
8240
|
if (!this.parent) {
|
|
8251
8241
|
if (this.selector)
|
|
@@ -8778,23 +8768,23 @@ var LeaferUI = (function (exports) {
|
|
|
8778
8768
|
}
|
|
8779
8769
|
__updateTextDrawData() {
|
|
8780
8770
|
const data = this.__;
|
|
8781
|
-
data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
|
|
8782
|
-
}
|
|
8783
|
-
__updateBoxBounds() {
|
|
8784
|
-
const data = this.__;
|
|
8785
|
-
const layout = this.__layout;
|
|
8786
8771
|
const { lineHeight, letterSpacing, fontFamily, fontSize, fontWeight, italic, textCase, textOverflow, padding } = data;
|
|
8787
|
-
const autoWidth = data.__autoWidth;
|
|
8788
|
-
const autoHeight = data.__autoHeight;
|
|
8789
8772
|
data.__lineHeight = UnitConvert.number(lineHeight, fontSize);
|
|
8790
8773
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
8791
8774
|
data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
|
|
8792
8775
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * 0.7) / 2;
|
|
8793
8776
|
data.__font = `${italic ? 'italic ' : ''}${textCase === 'small-caps' ? 'small-caps ' : ''}${fontWeight !== 'normal' ? fontWeight + ' ' : ''}${fontSize}px ${fontFamily}`;
|
|
8794
8777
|
data.__clipText = textOverflow !== 'show' && !data.__autoSize;
|
|
8778
|
+
data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
|
|
8779
|
+
}
|
|
8780
|
+
__updateBoxBounds() {
|
|
8781
|
+
const data = this.__;
|
|
8782
|
+
const layout = this.__layout;
|
|
8783
|
+
const { fontSize, italic, padding, __autoWidth: autoWidth, __autoHeight: autoHeight } = data;
|
|
8795
8784
|
this.__updateTextDrawData();
|
|
8796
8785
|
const { bounds } = data.__textDrawData;
|
|
8797
8786
|
const b = layout.boxBounds;
|
|
8787
|
+
console.log(bounds, autoWidth, autoHeight);
|
|
8798
8788
|
if (data.__lineHeight < fontSize)
|
|
8799
8789
|
spread(bounds, fontSize / 2);
|
|
8800
8790
|
if (autoWidth || autoHeight) {
|
|
@@ -8804,20 +8794,15 @@ var LeaferUI = (function (exports) {
|
|
|
8804
8794
|
b.height = autoHeight ? bounds.height : data.height;
|
|
8805
8795
|
if (padding) {
|
|
8806
8796
|
const [top, right, bottom, left] = data.__padding;
|
|
8807
|
-
if (autoWidth)
|
|
8808
|
-
b.x -= left;
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
if (autoHeight) {
|
|
8812
|
-
b.y -= top;
|
|
8813
|
-
b.height += (bottom + top);
|
|
8814
|
-
}
|
|
8797
|
+
if (autoWidth)
|
|
8798
|
+
b.x -= left, b.width += (right + left);
|
|
8799
|
+
if (autoHeight)
|
|
8800
|
+
b.y -= top, b.height += (bottom + top);
|
|
8815
8801
|
}
|
|
8816
8802
|
this.__updateNaturalSize();
|
|
8817
8803
|
}
|
|
8818
|
-
else
|
|
8804
|
+
else
|
|
8819
8805
|
super.__updateBoxBounds();
|
|
8820
|
-
}
|
|
8821
8806
|
if (italic)
|
|
8822
8807
|
b.width += fontSize * 0.16;
|
|
8823
8808
|
const contentBounds = includes(b, bounds) ? b : bounds;
|
|
@@ -8940,11 +8925,7 @@ var LeaferUI = (function (exports) {
|
|
|
8940
8925
|
this.add(path);
|
|
8941
8926
|
return this;
|
|
8942
8927
|
}
|
|
8943
|
-
beginPath() {
|
|
8944
|
-
this.__path.length = 0;
|
|
8945
|
-
this.paint();
|
|
8946
|
-
return this;
|
|
8947
|
-
}
|
|
8928
|
+
beginPath() { return this; }
|
|
8948
8929
|
moveTo(_x, _y) { return this; }
|
|
8949
8930
|
lineTo(_x, _y) { return this; }
|
|
8950
8931
|
bezierCurveTo(_x1, _y1, _x2, _y2, _x, _y) { return this; }
|
|
@@ -8971,7 +8952,7 @@ var LeaferUI = (function (exports) {
|
|
|
8971
8952
|
penPathType()
|
|
8972
8953
|
], exports.Pen.prototype, "path", void 0);
|
|
8973
8954
|
exports.Pen = __decorate([
|
|
8974
|
-
useModule(PathCreator, ['set', '
|
|
8955
|
+
useModule(PathCreator, ['set', 'path', 'paint']),
|
|
8975
8956
|
registerUI()
|
|
8976
8957
|
], exports.Pen);
|
|
8977
8958
|
function penPathType() {
|
|
@@ -9073,10 +9054,9 @@ var LeaferUI = (function (exports) {
|
|
|
9073
9054
|
}
|
|
9074
9055
|
__render(canvas, options) {
|
|
9075
9056
|
if (canvas.context) {
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
canvas.setTransform(a, b, c, d, e, f);
|
|
9079
|
-
}
|
|
9057
|
+
const m = options.matrix;
|
|
9058
|
+
if (m)
|
|
9059
|
+
canvas.setTransform(m.a, m.b, m.c, m.d, m.e, m.f);
|
|
9080
9060
|
this.children.forEach(leafer => canvas.copyWorld(leafer.canvas));
|
|
9081
9061
|
}
|
|
9082
9062
|
}
|
|
@@ -9146,9 +9126,6 @@ var LeaferUI = (function (exports) {
|
|
|
9146
9126
|
constructor(params) {
|
|
9147
9127
|
super(params.type);
|
|
9148
9128
|
this.bubbles = true;
|
|
9149
|
-
this.getInner = this.getInnerPoint;
|
|
9150
|
-
this.getLocal = this.getLocalPoint;
|
|
9151
|
-
this.getPage = this.getPagePoint;
|
|
9152
9129
|
Object.assign(this, params);
|
|
9153
9130
|
}
|
|
9154
9131
|
getBoxPoint(relative) {
|
|
@@ -9169,6 +9146,9 @@ var LeaferUI = (function (exports) {
|
|
|
9169
9146
|
getPagePoint() {
|
|
9170
9147
|
return this.current.getPagePoint(this);
|
|
9171
9148
|
}
|
|
9149
|
+
getInner(relative) { return this.getInnerPoint(relative); }
|
|
9150
|
+
getLocal(relative) { return this.getLocalPoint(relative); }
|
|
9151
|
+
getPage() { return this.getPagePoint(); }
|
|
9172
9152
|
static changeName(oldName, newName) {
|
|
9173
9153
|
EventCreator.changeName(oldName, newName);
|
|
9174
9154
|
}
|
|
@@ -9200,7 +9180,7 @@ var LeaferUI = (function (exports) {
|
|
|
9200
9180
|
], exports.PointerEvent);
|
|
9201
9181
|
const MyPointerEvent = exports.PointerEvent;
|
|
9202
9182
|
|
|
9203
|
-
const
|
|
9183
|
+
const tempMove = {};
|
|
9204
9184
|
exports.DragEvent = class DragEvent extends exports.PointerEvent {
|
|
9205
9185
|
static setList(data) {
|
|
9206
9186
|
this.list = data instanceof LeafList ? data : new LeafList(data);
|
|
@@ -9251,19 +9231,19 @@ var LeaferUI = (function (exports) {
|
|
|
9251
9231
|
}
|
|
9252
9232
|
getPageMove(total) {
|
|
9253
9233
|
this.assignMove(total);
|
|
9254
|
-
return this.current.getPagePoint(
|
|
9234
|
+
return this.current.getPagePoint(tempMove, null, true);
|
|
9255
9235
|
}
|
|
9256
9236
|
getInnerMove(relative, total) {
|
|
9257
9237
|
if (!relative)
|
|
9258
9238
|
relative = this.current;
|
|
9259
9239
|
this.assignMove(total);
|
|
9260
|
-
return relative.getInnerPoint(
|
|
9240
|
+
return relative.getInnerPoint(tempMove, null, true);
|
|
9261
9241
|
}
|
|
9262
9242
|
getLocalMove(relative, total) {
|
|
9263
9243
|
if (!relative)
|
|
9264
9244
|
relative = this.current;
|
|
9265
9245
|
this.assignMove(total);
|
|
9266
|
-
return relative.getLocalPoint(
|
|
9246
|
+
return relative.getLocalPoint(tempMove, null, true);
|
|
9267
9247
|
}
|
|
9268
9248
|
getPageTotal() {
|
|
9269
9249
|
return this.getPageMove(true);
|
|
@@ -9283,8 +9263,8 @@ var LeaferUI = (function (exports) {
|
|
|
9283
9263
|
return bounds;
|
|
9284
9264
|
}
|
|
9285
9265
|
assignMove(total) {
|
|
9286
|
-
|
|
9287
|
-
|
|
9266
|
+
tempMove.x = total ? this.totalX : this.moveX;
|
|
9267
|
+
tempMove.y = total ? this.totalY : this.moveY;
|
|
9288
9268
|
}
|
|
9289
9269
|
};
|
|
9290
9270
|
exports.DragEvent.BEFORE_DRAG = 'drag.before_drag';
|
|
@@ -9698,9 +9678,8 @@ var LeaferUI = (function (exports) {
|
|
|
9698
9678
|
interaction.emit(exports.DragEvent.OVER, data, path);
|
|
9699
9679
|
}
|
|
9700
9680
|
}
|
|
9701
|
-
else
|
|
9681
|
+
else
|
|
9702
9682
|
interaction.emit(exports.DragEvent.OVER, data, path);
|
|
9703
|
-
}
|
|
9704
9683
|
}
|
|
9705
9684
|
dragEnterOrLeave(data) {
|
|
9706
9685
|
const { interaction } = this;
|
|
@@ -9721,9 +9700,8 @@ var LeaferUI = (function (exports) {
|
|
|
9721
9700
|
this.drag(data);
|
|
9722
9701
|
this.animate(() => { this.dragEnd(data, 1); });
|
|
9723
9702
|
}
|
|
9724
|
-
else
|
|
9703
|
+
else
|
|
9725
9704
|
this.dragEndReal(data);
|
|
9726
|
-
}
|
|
9727
9705
|
}
|
|
9728
9706
|
dragEndReal(data) {
|
|
9729
9707
|
const { interaction, downData, dragData } = this;
|
|
@@ -9920,14 +9898,16 @@ var LeaferUI = (function (exports) {
|
|
|
9920
9898
|
class InteractionBase {
|
|
9921
9899
|
get dragging() { return this.dragger.dragging; }
|
|
9922
9900
|
get transforming() { return this.transformer.transforming; }
|
|
9923
|
-
get moveMode() { return this.
|
|
9924
|
-
get canHover() { return this.
|
|
9925
|
-
get isDragEmpty() { return this.
|
|
9926
|
-
get isMobileDragEmpty() { return this.
|
|
9927
|
-
get isHoldMiddleKey() { return this.
|
|
9928
|
-
get isHoldRightKey() { return this.
|
|
9929
|
-
get isHoldSpaceKey() { return this.
|
|
9930
|
-
get
|
|
9901
|
+
get moveMode() { return this.m.drag === true || this.isHoldSpaceKey || this.isHoldMiddleKey || (this.isHoldRightKey && this.dragger.moving) || this.isDragEmpty; }
|
|
9902
|
+
get canHover() { return this.p.hover && !this.config.mobile; }
|
|
9903
|
+
get isDragEmpty() { return this.m.dragEmpty && this.isRootPath(this.hoverData) && (!this.downData || this.isRootPath(this.downData)); }
|
|
9904
|
+
get isMobileDragEmpty() { return this.m.dragEmpty && !this.canHover && this.downData && this.isTreePath(this.downData); }
|
|
9905
|
+
get isHoldMiddleKey() { return this.m.holdMiddleKey && this.downData && PointerButton.middle(this.downData); }
|
|
9906
|
+
get isHoldRightKey() { return this.m.holdRightKey && this.downData && PointerButton.right(this.downData); }
|
|
9907
|
+
get isHoldSpaceKey() { return this.m.holdSpaceKey && Keyboard.isHoldSpaceKey(); }
|
|
9908
|
+
get m() { return this.config.move; }
|
|
9909
|
+
get p() { return this.config.pointer; }
|
|
9910
|
+
get hitRadius() { return this.p.hitRadius; }
|
|
9931
9911
|
constructor(target, canvas, selector, userConfig) {
|
|
9932
9912
|
this.config = DataHelper.clone(config);
|
|
9933
9913
|
this.tapCount = 0;
|
|
@@ -9985,7 +9965,7 @@ var LeaferUI = (function (exports) {
|
|
|
9985
9965
|
}
|
|
9986
9966
|
}
|
|
9987
9967
|
pointerMoveReal(data) {
|
|
9988
|
-
const { dragHover, dragDistance } = this.
|
|
9968
|
+
const { dragHover, dragDistance } = this.p;
|
|
9989
9969
|
this.emit(exports.PointerEvent.BEFORE_MOVE, data, this.defaultPath);
|
|
9990
9970
|
if (this.downData) {
|
|
9991
9971
|
const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
|
|
@@ -10170,7 +10150,7 @@ var LeaferUI = (function (exports) {
|
|
|
10170
10150
|
}
|
|
10171
10151
|
}
|
|
10172
10152
|
findPath(data, options) {
|
|
10173
|
-
const { hitRadius, through } = this.
|
|
10153
|
+
const { hitRadius, through } = this.p;
|
|
10174
10154
|
const { bottomList } = this;
|
|
10175
10155
|
const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
|
|
10176
10156
|
if (find.throughPath)
|
|
@@ -10192,7 +10172,7 @@ var LeaferUI = (function (exports) {
|
|
|
10192
10172
|
data.path = this.defaultPath;
|
|
10193
10173
|
}
|
|
10194
10174
|
canMove(data) {
|
|
10195
|
-
return data && (this.moveMode || (this.
|
|
10175
|
+
return data && (this.moveMode || (this.m.drag === 'auto' && !pathCanDrag$1(data.path))) && !pathHasOutside(data.path);
|
|
10196
10176
|
}
|
|
10197
10177
|
isDrag(leaf) {
|
|
10198
10178
|
return this.dragger.getList().has(leaf);
|
|
@@ -10290,7 +10270,7 @@ var LeaferUI = (function (exports) {
|
|
|
10290
10270
|
this.longPressTimer = setTimeout(() => {
|
|
10291
10271
|
this.longPressed = true;
|
|
10292
10272
|
this.emit(exports.PointerEvent.LONG_PRESS, data);
|
|
10293
|
-
}, this.
|
|
10273
|
+
}, this.p.longPressTime);
|
|
10294
10274
|
}
|
|
10295
10275
|
longTap(data) {
|
|
10296
10276
|
let hasLong;
|
|
@@ -10895,14 +10875,10 @@ var LeaferUI = (function (exports) {
|
|
|
10895
10875
|
const { rows, decorationY, decorationHeight } = ui.__.__textDrawData;
|
|
10896
10876
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10897
10877
|
row = rows[i];
|
|
10898
|
-
if (row.text)
|
|
10878
|
+
if (row.text)
|
|
10899
10879
|
canvas.fillText(row.text, row.x, row.y);
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
row.data.forEach(charData => {
|
|
10903
|
-
canvas.fillText(charData.char, charData.x, row.y);
|
|
10904
|
-
});
|
|
10905
|
-
}
|
|
10880
|
+
else if (row.data)
|
|
10881
|
+
row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
|
|
10906
10882
|
if (decorationY)
|
|
10907
10883
|
canvas.fillRect(row.x, row.y + decorationY, row.width, decorationHeight);
|
|
10908
10884
|
}
|
|
@@ -10968,12 +10944,10 @@ var LeaferUI = (function (exports) {
|
|
|
10968
10944
|
out.blendMode = align === 'outside' ? 'destination-out' : 'destination-in';
|
|
10969
10945
|
fillText(ui, out);
|
|
10970
10946
|
out.blendMode = 'normal';
|
|
10971
|
-
if (ui.__worldFlipped)
|
|
10947
|
+
if (ui.__worldFlipped)
|
|
10972
10948
|
canvas.copyWorldByReset(out, ui.__nowWorld);
|
|
10973
|
-
|
|
10974
|
-
else {
|
|
10949
|
+
else
|
|
10975
10950
|
canvas.copyWorldToInner(out, ui.__nowWorld, ui.__layout.renderBounds);
|
|
10976
|
-
}
|
|
10977
10951
|
out.recycle(ui.__nowWorld);
|
|
10978
10952
|
}
|
|
10979
10953
|
function drawTextStroke(ui, canvas) {
|
|
@@ -10981,14 +10955,10 @@ var LeaferUI = (function (exports) {
|
|
|
10981
10955
|
const { rows, decorationY, decorationHeight } = ui.__.__textDrawData;
|
|
10982
10956
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10983
10957
|
row = rows[i];
|
|
10984
|
-
if (row.text)
|
|
10958
|
+
if (row.text)
|
|
10985
10959
|
canvas.strokeText(row.text, row.x, row.y);
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
row.data.forEach(charData => {
|
|
10989
|
-
canvas.strokeText(charData.char, charData.x, row.y);
|
|
10990
|
-
});
|
|
10991
|
-
}
|
|
10960
|
+
else if (row.data)
|
|
10961
|
+
row.data.forEach(charData => { canvas.strokeText(charData.char, charData.x, row.y); });
|
|
10992
10962
|
if (decorationY)
|
|
10993
10963
|
canvas.strokeRect(row.x, row.y + decorationY, row.width, decorationHeight);
|
|
10994
10964
|
}
|
|
@@ -11041,12 +11011,10 @@ var LeaferUI = (function (exports) {
|
|
|
11041
11011
|
out.stroke();
|
|
11042
11012
|
options.windingRule ? out.clip(options.windingRule) : out.clip();
|
|
11043
11013
|
out.clearWorld(ui.__layout.renderBounds);
|
|
11044
|
-
if (ui.__worldFlipped)
|
|
11014
|
+
if (ui.__worldFlipped)
|
|
11045
11015
|
canvas.copyWorldByReset(out, ui.__nowWorld);
|
|
11046
|
-
|
|
11047
|
-
else {
|
|
11016
|
+
else
|
|
11048
11017
|
canvas.copyWorldToInner(out, ui.__nowWorld, ui.__layout.renderBounds);
|
|
11049
|
-
}
|
|
11050
11018
|
out.recycle(ui.__nowWorld);
|
|
11051
11019
|
break;
|
|
11052
11020
|
}
|
|
@@ -11081,12 +11049,10 @@ var LeaferUI = (function (exports) {
|
|
|
11081
11049
|
drawStrokesStyle(strokes, false, ui, out);
|
|
11082
11050
|
options.windingRule ? out.clip(options.windingRule) : out.clip();
|
|
11083
11051
|
out.clearWorld(renderBounds);
|
|
11084
|
-
if (ui.__worldFlipped)
|
|
11052
|
+
if (ui.__worldFlipped)
|
|
11085
11053
|
canvas.copyWorldByReset(out, ui.__nowWorld);
|
|
11086
|
-
|
|
11087
|
-
else {
|
|
11054
|
+
else
|
|
11088
11055
|
canvas.copyWorldToInner(out, ui.__nowWorld, renderBounds);
|
|
11089
|
-
}
|
|
11090
11056
|
out.recycle(ui.__nowWorld);
|
|
11091
11057
|
break;
|
|
11092
11058
|
}
|
|
@@ -11150,12 +11116,7 @@ var LeaferUI = (function (exports) {
|
|
|
11150
11116
|
data['_' + attrName] = leafPaints.length ? leafPaints : undefined;
|
|
11151
11117
|
if (leafPaints.length && leafPaints[0].image)
|
|
11152
11118
|
hasOpacityPixel = leafPaints[0].image.hasOpacityPixel;
|
|
11153
|
-
|
|
11154
|
-
data.__pixelFill = hasOpacityPixel;
|
|
11155
|
-
}
|
|
11156
|
-
else {
|
|
11157
|
-
data.__pixelStroke = hasOpacityPixel;
|
|
11158
|
-
}
|
|
11119
|
+
attrName === 'fill' ? data.__pixelFill = hasOpacityPixel : data.__pixelStroke = hasOpacityPixel;
|
|
11159
11120
|
}
|
|
11160
11121
|
function getLeafPaint(attrName, paint, ui) {
|
|
11161
11122
|
if (typeof paint !== 'object' || paint.visible === false || paint.opacity === 0)
|