@leafer-ui/worker 1.0.0 → 1.0.1
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.esm.js +11 -6
- package/dist/worker.esm.min.js +1 -1
- package/dist/worker.js +95 -48
- package/dist/worker.min.js +1 -1
- package/dist/worker.module.js +95 -48
- package/dist/worker.module.min.js +1 -1
- package/package.json +9 -9
package/dist/worker.js
CHANGED
|
@@ -51,6 +51,8 @@ var LeaferUI = (function (exports) {
|
|
|
51
51
|
const { round, pow: pow$1, PI: PI$4 } = Math;
|
|
52
52
|
const MathHelper = {
|
|
53
53
|
within(value, min, max) {
|
|
54
|
+
if (typeof min === 'object')
|
|
55
|
+
max = min.max, min = min.min;
|
|
54
56
|
if (min !== undefined && value < min)
|
|
55
57
|
value = min;
|
|
56
58
|
if (max !== undefined && value > max)
|
|
@@ -153,10 +155,10 @@ var LeaferUI = (function (exports) {
|
|
|
153
155
|
t.e += x;
|
|
154
156
|
t.f += y;
|
|
155
157
|
},
|
|
156
|
-
translateInner(t, x, y,
|
|
158
|
+
translateInner(t, x, y, hasOrigin) {
|
|
157
159
|
t.e += t.a * x + t.c * y;
|
|
158
160
|
t.f += t.b * x + t.d * y;
|
|
159
|
-
if (
|
|
161
|
+
if (hasOrigin)
|
|
160
162
|
t.e -= x, t.f -= y;
|
|
161
163
|
},
|
|
162
164
|
scale(t, scaleX, scaleY = scaleX) {
|
|
@@ -315,7 +317,7 @@ var LeaferUI = (function (exports) {
|
|
|
315
317
|
to.y -= (f * a - e * b) * s;
|
|
316
318
|
}
|
|
317
319
|
},
|
|
318
|
-
setLayout(t, layout, origin, bcChanged) {
|
|
320
|
+
setLayout(t, layout, origin, around, bcChanged) {
|
|
319
321
|
const { x, y, scaleX, scaleY } = layout;
|
|
320
322
|
if (bcChanged === undefined)
|
|
321
323
|
bcChanged = layout.rotation || layout.skewX || layout.skewY;
|
|
@@ -347,10 +349,10 @@ var LeaferUI = (function (exports) {
|
|
|
347
349
|
}
|
|
348
350
|
t.e = x;
|
|
349
351
|
t.f = y;
|
|
350
|
-
if (origin)
|
|
351
|
-
M$6.translateInner(t, -origin.x, -origin.y,
|
|
352
|
+
if (origin = origin || around)
|
|
353
|
+
M$6.translateInner(t, -origin.x, -origin.y, !around);
|
|
352
354
|
},
|
|
353
|
-
getLayout(t, origin, firstSkewY) {
|
|
355
|
+
getLayout(t, origin, around, firstSkewY) {
|
|
354
356
|
const { a, b, c, d, e, f } = t;
|
|
355
357
|
let x = e, y = f, scaleX, scaleY, rotation, skewX, skewY;
|
|
356
358
|
if (b || c) {
|
|
@@ -379,9 +381,11 @@ var LeaferUI = (function (exports) {
|
|
|
379
381
|
scaleY = d;
|
|
380
382
|
rotation = skewX = skewY = 0;
|
|
381
383
|
}
|
|
382
|
-
if (origin) {
|
|
384
|
+
if (origin = around || origin) {
|
|
383
385
|
x += origin.x * a + origin.y * c;
|
|
384
386
|
y += origin.x * b + origin.y * d;
|
|
387
|
+
if (!around)
|
|
388
|
+
x -= origin.x, y -= origin.y;
|
|
385
389
|
}
|
|
386
390
|
return { x, y, scaleX, scaleY, rotation, skewX, skewY };
|
|
387
391
|
},
|
|
@@ -709,12 +713,12 @@ var LeaferUI = (function (exports) {
|
|
|
709
713
|
toInnerPoint(outer, to, distance) {
|
|
710
714
|
MatrixHelper.toInnerPoint(this, outer, to, distance);
|
|
711
715
|
}
|
|
712
|
-
setLayout(data, origin) {
|
|
713
|
-
MatrixHelper.setLayout(this, data, origin);
|
|
716
|
+
setLayout(data, origin, around) {
|
|
717
|
+
MatrixHelper.setLayout(this, data, origin, around);
|
|
714
718
|
return this;
|
|
715
719
|
}
|
|
716
|
-
getLayout(origin, firstSkewY) {
|
|
717
|
-
return MatrixHelper.getLayout(this, origin, firstSkewY);
|
|
720
|
+
getLayout(origin, around, firstSkewY) {
|
|
721
|
+
return MatrixHelper.getLayout(this, origin, around, firstSkewY);
|
|
718
722
|
}
|
|
719
723
|
withScale(scaleX, scaleY) {
|
|
720
724
|
return MatrixHelper.withScale(this, scaleX, scaleY);
|
|
@@ -2002,7 +2006,7 @@ var LeaferUI = (function (exports) {
|
|
|
2002
2006
|
DataHelper.copyAttrs(this.size, size, canvasSizeAttrs);
|
|
2003
2007
|
this.size.pixelRatio || (this.size.pixelRatio = 1);
|
|
2004
2008
|
this.bounds = new Bounds(0, 0, this.width, this.height);
|
|
2005
|
-
if (!this.unreal) {
|
|
2009
|
+
if (this.context && !this.unreal) {
|
|
2006
2010
|
this.updateViewSize();
|
|
2007
2011
|
this.smooth = this.config.smooth;
|
|
2008
2012
|
}
|
|
@@ -2175,7 +2179,7 @@ var LeaferUI = (function (exports) {
|
|
|
2175
2179
|
this.manager ? this.manager.recycle(this) : this.destroy();
|
|
2176
2180
|
}
|
|
2177
2181
|
}
|
|
2178
|
-
updateRender() { }
|
|
2182
|
+
updateRender(_bounds) { }
|
|
2179
2183
|
unrealCanvas() { }
|
|
2180
2184
|
destroy() {
|
|
2181
2185
|
this.manager = this.view = this.parentView = null;
|
|
@@ -4069,8 +4073,13 @@ var LeaferUI = (function (exports) {
|
|
|
4069
4073
|
zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize) {
|
|
4070
4074
|
copy$7(matrix$1, t.__localMatrix);
|
|
4071
4075
|
scaleOfOuter$2(matrix$1, origin, scaleX, scaleY);
|
|
4072
|
-
|
|
4073
|
-
|
|
4076
|
+
if (t.origin || t.around) {
|
|
4077
|
+
L.setTransform(t, matrix$1, resize);
|
|
4078
|
+
}
|
|
4079
|
+
else {
|
|
4080
|
+
moveByMatrix(t, matrix$1);
|
|
4081
|
+
t.scaleResize(scaleX, scaleY, resize !== true);
|
|
4082
|
+
}
|
|
4074
4083
|
},
|
|
4075
4084
|
rotateOfWorld(t, origin, angle) {
|
|
4076
4085
|
L.rotateOfLocal(t, getTempLocal(t, origin), angle);
|
|
@@ -4078,8 +4087,13 @@ var LeaferUI = (function (exports) {
|
|
|
4078
4087
|
rotateOfLocal(t, origin, angle) {
|
|
4079
4088
|
copy$7(matrix$1, t.__localMatrix);
|
|
4080
4089
|
rotateOfOuter$2(matrix$1, origin, angle);
|
|
4081
|
-
|
|
4082
|
-
|
|
4090
|
+
if (t.origin || t.around) {
|
|
4091
|
+
L.setTransform(t, matrix$1);
|
|
4092
|
+
}
|
|
4093
|
+
else {
|
|
4094
|
+
moveByMatrix(t, matrix$1);
|
|
4095
|
+
t.rotation = MathHelper.formatRotation(t.rotation + angle);
|
|
4096
|
+
}
|
|
4083
4097
|
},
|
|
4084
4098
|
skewOfWorld(t, origin, skewX, skewY, resize) {
|
|
4085
4099
|
L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize);
|
|
@@ -4102,7 +4116,7 @@ var LeaferUI = (function (exports) {
|
|
|
4102
4116
|
L.setTransform(t, matrix$1, resize);
|
|
4103
4117
|
},
|
|
4104
4118
|
setTransform(t, transform, resize) {
|
|
4105
|
-
const layout = getLayout(transform);
|
|
4119
|
+
const layout = getLayout(transform, t.origin && L.getInnerOrigin(t, t.origin), t.around && L.getInnerOrigin(t, t.around));
|
|
4106
4120
|
if (resize) {
|
|
4107
4121
|
const scaleX = layout.scaleX / t.scaleX;
|
|
4108
4122
|
const scaleY = layout.scaleY / t.scaleY;
|
|
@@ -4115,13 +4129,19 @@ var LeaferUI = (function (exports) {
|
|
|
4115
4129
|
t.set(layout);
|
|
4116
4130
|
}
|
|
4117
4131
|
},
|
|
4132
|
+
getFlipTransform(t, axis) {
|
|
4133
|
+
const m = getMatrixData();
|
|
4134
|
+
const sign = axis === 'x' ? 1 : -1;
|
|
4135
|
+
scaleOfOuter$2(m, L.getLocalOrigin(t, 'center'), -1 * sign, 1 * sign);
|
|
4136
|
+
return m;
|
|
4137
|
+
},
|
|
4118
4138
|
getLocalOrigin(t, origin) {
|
|
4119
4139
|
return PointHelper.tempToOuterOf(L.getInnerOrigin(t, origin), t.localTransform);
|
|
4120
4140
|
},
|
|
4121
4141
|
getInnerOrigin(t, origin) {
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
return
|
|
4142
|
+
const innerOrigin = {};
|
|
4143
|
+
AroundHelper.toPoint(origin, t.boxBounds, innerOrigin);
|
|
4144
|
+
return innerOrigin;
|
|
4125
4145
|
},
|
|
4126
4146
|
getRelativeWorld(t, relative, temp) {
|
|
4127
4147
|
copy$7(matrix$1, t.worldTransform);
|
|
@@ -4548,7 +4568,10 @@ var LeaferUI = (function (exports) {
|
|
|
4548
4568
|
on(type, listener, options) {
|
|
4549
4569
|
let capture, once;
|
|
4550
4570
|
if (options) {
|
|
4551
|
-
if (
|
|
4571
|
+
if (options === 'once') {
|
|
4572
|
+
once = true;
|
|
4573
|
+
}
|
|
4574
|
+
else if (typeof options === 'boolean') {
|
|
4552
4575
|
capture = options;
|
|
4553
4576
|
}
|
|
4554
4577
|
else {
|
|
@@ -4579,7 +4602,7 @@ var LeaferUI = (function (exports) {
|
|
|
4579
4602
|
if (listener) {
|
|
4580
4603
|
let capture;
|
|
4581
4604
|
if (options)
|
|
4582
|
-
capture = typeof options === 'boolean' ? options : options.capture;
|
|
4605
|
+
capture = typeof options === 'boolean' ? options : (options === 'once' ? false : options.capture);
|
|
4583
4606
|
let events, index;
|
|
4584
4607
|
const map = __getListenerMap(this, capture);
|
|
4585
4608
|
typeList.forEach(type => {
|
|
@@ -4881,7 +4904,7 @@ var LeaferUI = (function (exports) {
|
|
|
4881
4904
|
const layout = this.__layout, local = this.__local, data = this.__;
|
|
4882
4905
|
if (layout.affectScaleOrRotation) {
|
|
4883
4906
|
if (layout.scaleChanged || layout.rotationChanged) {
|
|
4884
|
-
setLayout(local, data, null, layout.affectRotation);
|
|
4907
|
+
setLayout(local, data, null, null, layout.affectRotation);
|
|
4885
4908
|
layout.scaleChanged = layout.rotationChanged = false;
|
|
4886
4909
|
}
|
|
4887
4910
|
}
|
|
@@ -4889,7 +4912,7 @@ var LeaferUI = (function (exports) {
|
|
|
4889
4912
|
local.f = data.y + data.offsetY;
|
|
4890
4913
|
if (data.around || data.origin) {
|
|
4891
4914
|
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$1);
|
|
4892
|
-
translateInner(local, -tempPoint$1.x, -tempPoint$1.y, data.
|
|
4915
|
+
translateInner(local, -tempPoint$1.x, -tempPoint$1.y, !data.around);
|
|
4893
4916
|
}
|
|
4894
4917
|
}
|
|
4895
4918
|
this.__layout.matrixChanged = false;
|
|
@@ -5118,7 +5141,7 @@ var LeaferUI = (function (exports) {
|
|
|
5118
5141
|
const { toInnerPoint, toOuterPoint, multiplyParent } = MatrixHelper;
|
|
5119
5142
|
const { toOuterOf } = BoundsHelper;
|
|
5120
5143
|
const { copy: copy$4 } = PointHelper;
|
|
5121
|
-
const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal, moveWorld, zoomOfWorld, rotateOfWorld, skewOfWorld, transform, transformWorld, setTransform, getLocalOrigin, getRelativeWorld, drop } = LeafHelper;
|
|
5144
|
+
const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal, moveWorld, zoomOfWorld, rotateOfWorld, skewOfWorld, transform, transformWorld, setTransform, getFlipTransform, getLocalOrigin, getRelativeWorld, drop } = LeafHelper;
|
|
5122
5145
|
exports.Leaf = class Leaf {
|
|
5123
5146
|
get tag() { return this.__tag; }
|
|
5124
5147
|
set tag(_value) { }
|
|
@@ -5144,6 +5167,8 @@ var LeaferUI = (function (exports) {
|
|
|
5144
5167
|
get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
|
|
5145
5168
|
get __inLazyBounds() { const { leafer } = this; return leafer && leafer.created && leafer.lazyBounds.hit(this.__world); }
|
|
5146
5169
|
get pathInputed() { return this.__.__pathInputed; }
|
|
5170
|
+
set event(map) { let event; for (let key in map)
|
|
5171
|
+
event = map[key], event instanceof Array ? this.on(key, event[0], event[1]) : this.on(key, event); }
|
|
5147
5172
|
constructor(data) {
|
|
5148
5173
|
this.innerId = create(LEAF);
|
|
5149
5174
|
this.reset(data);
|
|
@@ -5403,6 +5428,9 @@ var LeaferUI = (function (exports) {
|
|
|
5403
5428
|
skewOfWorld(worldOrigin, skewX, skewY, resize) {
|
|
5404
5429
|
skewOfWorld(this, worldOrigin, skewX, skewY, resize);
|
|
5405
5430
|
}
|
|
5431
|
+
flip(axis) {
|
|
5432
|
+
transform(this, getFlipTransform(this, axis));
|
|
5433
|
+
}
|
|
5406
5434
|
scaleResize(scaleX, scaleY = scaleX, _noResize) {
|
|
5407
5435
|
this.scaleX *= scaleX;
|
|
5408
5436
|
this.scaleY *= scaleY;
|
|
@@ -5760,7 +5788,7 @@ var LeaferUI = (function (exports) {
|
|
|
5760
5788
|
}
|
|
5761
5789
|
}
|
|
5762
5790
|
|
|
5763
|
-
const version = "1.0.
|
|
5791
|
+
const version = "1.0.1";
|
|
5764
5792
|
const inviteCode = {};
|
|
5765
5793
|
|
|
5766
5794
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
@@ -5830,7 +5858,7 @@ var LeaferUI = (function (exports) {
|
|
|
5830
5858
|
Platform.name = 'web';
|
|
5831
5859
|
Platform.isWorker = true;
|
|
5832
5860
|
Platform.requestRender = function (render) { requestAnimationFrame(render); };
|
|
5833
|
-
Platform
|
|
5861
|
+
defineKey(Platform, 'devicePixelRatio', { get() { return 1; } });
|
|
5834
5862
|
const { userAgent } = navigator;
|
|
5835
5863
|
if (userAgent.indexOf("Firefox") > -1) {
|
|
5836
5864
|
Platform.conicGradientRotate90 = true;
|
|
@@ -6326,14 +6354,14 @@ var LeaferUI = (function (exports) {
|
|
|
6326
6354
|
if (Debug.showRepaint)
|
|
6327
6355
|
this.canvas.strokeWorld(bounds, 'red');
|
|
6328
6356
|
this.target.__render(this.canvas, options);
|
|
6329
|
-
this.renderBounds = realBounds || bounds;
|
|
6357
|
+
this.renderBounds = realBounds = realBounds || bounds;
|
|
6330
6358
|
this.renderOptions = options;
|
|
6331
|
-
this.totalBounds.isEmpty() ? this.totalBounds =
|
|
6359
|
+
this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
|
|
6332
6360
|
if (Debug.showHitView)
|
|
6333
6361
|
this.renderHitView(options);
|
|
6334
6362
|
if (Debug.showBoundsView)
|
|
6335
6363
|
this.renderBoundsView(options);
|
|
6336
|
-
this.canvas.updateRender();
|
|
6364
|
+
this.canvas.updateRender(realBounds);
|
|
6337
6365
|
}
|
|
6338
6366
|
renderHitView(_options) { }
|
|
6339
6367
|
renderBoundsView(_options) { }
|
|
@@ -7655,7 +7683,7 @@ var LeaferUI = (function (exports) {
|
|
|
7655
7683
|
this.__controllers.push(this.renderer = Creator.renderer(this, canvas, config), this.watcher = Creator.watcher(this, config), this.layouter = Creator.layouter(this, config));
|
|
7656
7684
|
if (this.isApp)
|
|
7657
7685
|
this.__setApp();
|
|
7658
|
-
this.__checkAutoLayout(config);
|
|
7686
|
+
this.__checkAutoLayout(config, parentApp);
|
|
7659
7687
|
this.view = canvas.view;
|
|
7660
7688
|
if (parentApp) {
|
|
7661
7689
|
this.__bindApp(parentApp);
|
|
@@ -7756,9 +7784,10 @@ var LeaferUI = (function (exports) {
|
|
|
7756
7784
|
this.leafer = leafer;
|
|
7757
7785
|
this.__level = 1;
|
|
7758
7786
|
}
|
|
7759
|
-
__checkAutoLayout(config) {
|
|
7760
|
-
if (!
|
|
7761
|
-
|
|
7787
|
+
__checkAutoLayout(config, parentApp) {
|
|
7788
|
+
if (!parentApp) {
|
|
7789
|
+
if (!config.width || !config.height)
|
|
7790
|
+
this.autoLayout = new AutoBounds(config);
|
|
7762
7791
|
this.canvas.startAutoLayout(this.autoLayout, this.__onResize.bind(this));
|
|
7763
7792
|
}
|
|
7764
7793
|
}
|
|
@@ -7893,7 +7922,9 @@ var LeaferUI = (function (exports) {
|
|
|
7893
7922
|
list.push(item);
|
|
7894
7923
|
}
|
|
7895
7924
|
}
|
|
7896
|
-
zoom(_zoomType, _padding, _fixedScale) {
|
|
7925
|
+
zoom(_zoomType, _padding, _fixedScale) {
|
|
7926
|
+
return debug$3.error('need @leafer-in/view');
|
|
7927
|
+
}
|
|
7897
7928
|
getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
|
|
7898
7929
|
getValidScale(changeScale) { return changeScale; }
|
|
7899
7930
|
getWorldPointByClient(clientPoint, updateClient) {
|
|
@@ -8420,8 +8451,7 @@ var LeaferUI = (function (exports) {
|
|
|
8420
8451
|
destroy() {
|
|
8421
8452
|
if (this.canvas) {
|
|
8422
8453
|
this.canvas.destroy();
|
|
8423
|
-
this.canvas = null;
|
|
8424
|
-
this.context = null;
|
|
8454
|
+
this.canvas = this.context = null;
|
|
8425
8455
|
}
|
|
8426
8456
|
super.destroy();
|
|
8427
8457
|
}
|
|
@@ -8774,11 +8804,13 @@ var LeaferUI = (function (exports) {
|
|
|
8774
8804
|
this.renderer.update();
|
|
8775
8805
|
}
|
|
8776
8806
|
__render(canvas, options) {
|
|
8777
|
-
if (
|
|
8778
|
-
|
|
8779
|
-
|
|
8807
|
+
if (canvas.context) {
|
|
8808
|
+
if (options.matrix) {
|
|
8809
|
+
const { a, b, c, d, e, f } = options.matrix;
|
|
8810
|
+
canvas.setTransform(a, b, c, d, e, f);
|
|
8811
|
+
}
|
|
8812
|
+
this.children.forEach(leafer => canvas.copyWorld(leafer.canvas));
|
|
8780
8813
|
}
|
|
8781
|
-
this.children.forEach(leafer => canvas.copyWorld(leafer.canvas));
|
|
8782
8814
|
}
|
|
8783
8815
|
__onResize(event) {
|
|
8784
8816
|
this.children.forEach(leafer => leafer.resize(event));
|
|
@@ -9145,11 +9177,14 @@ var LeaferUI = (function (exports) {
|
|
|
9145
9177
|
};
|
|
9146
9178
|
|
|
9147
9179
|
class Transformer {
|
|
9180
|
+
get transforming() { return !!(this.moveData || this.zoomData || this.rotateData); }
|
|
9148
9181
|
constructor(interaction) {
|
|
9149
9182
|
this.interaction = interaction;
|
|
9150
9183
|
}
|
|
9151
9184
|
move(data) {
|
|
9152
9185
|
const { interaction } = this;
|
|
9186
|
+
if (!data.moveType)
|
|
9187
|
+
data.moveType = 'move';
|
|
9153
9188
|
if (!this.moveData) {
|
|
9154
9189
|
const { path } = interaction.selector.getByPoint(data, interaction.hitRadius);
|
|
9155
9190
|
data.path = path;
|
|
@@ -9314,8 +9349,10 @@ var LeaferUI = (function (exports) {
|
|
|
9314
9349
|
return;
|
|
9315
9350
|
}
|
|
9316
9351
|
if (!this.moving && canDrag) {
|
|
9317
|
-
if (this.moving = interaction.canMove(this.downData) || interaction.isHoldRightKey || interaction.isMobileDragEmpty)
|
|
9352
|
+
if (this.moving = interaction.canMove(this.downData) || interaction.isHoldRightKey || interaction.isMobileDragEmpty) {
|
|
9353
|
+
this.dragData.moveType = 'drag';
|
|
9318
9354
|
interaction.emit(exports.MoveEvent.START, this.dragData);
|
|
9355
|
+
}
|
|
9319
9356
|
}
|
|
9320
9357
|
if (!this.moving) {
|
|
9321
9358
|
this.dragStart(data, canDrag);
|
|
@@ -9354,6 +9391,7 @@ var LeaferUI = (function (exports) {
|
|
|
9354
9391
|
this.dragData.throughPath = throughPath;
|
|
9355
9392
|
this.dragData.path = path;
|
|
9356
9393
|
if (this.moving) {
|
|
9394
|
+
this.dragData.moveType = 'drag';
|
|
9357
9395
|
interaction.emit(exports.MoveEvent.BEFORE_MOVE, this.dragData);
|
|
9358
9396
|
interaction.emit(exports.MoveEvent.MOVE, this.dragData);
|
|
9359
9397
|
}
|
|
@@ -9420,6 +9458,7 @@ var LeaferUI = (function (exports) {
|
|
|
9420
9458
|
endDragData.path = path;
|
|
9421
9459
|
if (this.moving) {
|
|
9422
9460
|
this.moving = false;
|
|
9461
|
+
endDragData.moveType = 'drag';
|
|
9423
9462
|
interaction.emit(exports.MoveEvent.END, endDragData);
|
|
9424
9463
|
}
|
|
9425
9464
|
if (this.dragging) {
|
|
@@ -9478,7 +9517,7 @@ var LeaferUI = (function (exports) {
|
|
|
9478
9517
|
totalY += moveY;
|
|
9479
9518
|
PointHelper.move(downData, moveX, moveY);
|
|
9480
9519
|
PointHelper.move(this.dragData, moveX, moveY);
|
|
9481
|
-
interaction.move(Object.assign(Object.assign({}, data), { moveX, moveY, totalX, totalY }));
|
|
9520
|
+
interaction.move(Object.assign(Object.assign({}, data), { moveX, moveY, totalX, totalY, moveType: 'drag' }));
|
|
9482
9521
|
interaction.pointerMoveReal(data);
|
|
9483
9522
|
}, 10);
|
|
9484
9523
|
}
|
|
@@ -9598,9 +9637,11 @@ var LeaferUI = (function (exports) {
|
|
|
9598
9637
|
const { pathHasEventType, getMoveEventData, getZoomEventData, getRotateEventData } = InteractionHelper;
|
|
9599
9638
|
class InteractionBase {
|
|
9600
9639
|
get dragging() { return this.dragger.dragging; }
|
|
9640
|
+
get transforming() { return this.transformer.transforming; }
|
|
9601
9641
|
get moveMode() { return this.config.move.drag || this.isHoldSpaceKey || this.isHoldMiddleKey || (this.isHoldRightKey && this.dragger.moving) || this.isDragEmpty; }
|
|
9642
|
+
get canHover() { return this.config.pointer.hover && !this.config.mobile; }
|
|
9602
9643
|
get isDragEmpty() { return this.config.move.dragEmpty && this.isRootPath(this.hoverData) && (!this.downData || this.isRootPath(this.downData)); }
|
|
9603
|
-
get isMobileDragEmpty() { return this.config.move.dragEmpty && !this.
|
|
9644
|
+
get isMobileDragEmpty() { return this.config.move.dragEmpty && !this.canHover && this.downData && this.isTreePath(this.downData); }
|
|
9604
9645
|
get isHoldMiddleKey() { return this.config.move.holdMiddleKey && this.downData && PointerButton.middle(this.downData); }
|
|
9605
9646
|
get isHoldRightKey() { return this.config.move.holdRightKey && this.downData && PointerButton.right(this.downData); }
|
|
9606
9647
|
get isHoldSpaceKey() { return this.config.move.holdSpaceKey && Keyboard.isHoldSpaceKey(); }
|
|
@@ -9693,6 +9734,7 @@ var LeaferUI = (function (exports) {
|
|
|
9693
9734
|
if (!downData)
|
|
9694
9735
|
return;
|
|
9695
9736
|
PointerButton.defaultLeft(data);
|
|
9737
|
+
data.multiTouch = downData.multiTouch;
|
|
9696
9738
|
this.findPath(data);
|
|
9697
9739
|
const upData = Object.assign(Object.assign({}, data), { path: data.path.clone() });
|
|
9698
9740
|
data.path.addList(downData.path.list);
|
|
@@ -9765,7 +9807,7 @@ var LeaferUI = (function (exports) {
|
|
|
9765
9807
|
this.updateCursor();
|
|
9766
9808
|
}
|
|
9767
9809
|
pointerHover(data) {
|
|
9768
|
-
if (this.
|
|
9810
|
+
if (this.canHover) {
|
|
9769
9811
|
this.pointerOverOrOut(data);
|
|
9770
9812
|
this.pointerEnterOrLeave(data);
|
|
9771
9813
|
}
|
|
@@ -9902,7 +9944,7 @@ var LeaferUI = (function (exports) {
|
|
|
9902
9944
|
this.hoverData = data;
|
|
9903
9945
|
}
|
|
9904
9946
|
updateCursor(data) {
|
|
9905
|
-
if (!this.config.cursor || !this.
|
|
9947
|
+
if (!this.config.cursor || !this.canHover)
|
|
9906
9948
|
return;
|
|
9907
9949
|
if (!data) {
|
|
9908
9950
|
this.updateHoverData();
|
|
@@ -10790,7 +10832,7 @@ var LeaferUI = (function (exports) {
|
|
|
10790
10832
|
const { abs } = Math;
|
|
10791
10833
|
function checkImage(ui, canvas, paint, allowPaint) {
|
|
10792
10834
|
const { scaleX, scaleY } = ImageManager.patternLocked ? ui.__world : ui.__nowWorld;
|
|
10793
|
-
if (!paint.data || paint.patternId === scaleX + '-' + scaleY) {
|
|
10835
|
+
if (!paint.data || (paint.patternId === scaleX + '-' + scaleY && !Export.running)) {
|
|
10794
10836
|
return false;
|
|
10795
10837
|
}
|
|
10796
10838
|
else {
|
|
@@ -11768,7 +11810,10 @@ var LeaferUI = (function (exports) {
|
|
|
11768
11810
|
const { x, y, width, height } = new Bounds(renderBounds).scale(scale);
|
|
11769
11811
|
let canvas = Creator.canvas({ width: Math.round(width), height: Math.round(height), pixelRatio, smooth, contextSettings });
|
|
11770
11812
|
const renderOptions = { matrix: matrix.scale(1 / scale).invert().translate(-x, -y).withScale(1 / scaleX * scale, 1 / scaleY * scale) };
|
|
11813
|
+
let sliceLeaf;
|
|
11771
11814
|
if (slice) {
|
|
11815
|
+
sliceLeaf = leaf;
|
|
11816
|
+
sliceLeaf.__worldOpacity = 0;
|
|
11772
11817
|
leaf = leafer;
|
|
11773
11818
|
renderOptions.bounds = canvas.bounds;
|
|
11774
11819
|
}
|
|
@@ -11783,6 +11828,8 @@ var LeaferUI = (function (exports) {
|
|
|
11783
11828
|
leaf.__render(canvas, renderOptions);
|
|
11784
11829
|
}
|
|
11785
11830
|
canvas.restore();
|
|
11831
|
+
if (sliceLeaf)
|
|
11832
|
+
sliceLeaf.__updateWorldOpacity();
|
|
11786
11833
|
if (trim) {
|
|
11787
11834
|
trimBounds = getTrimBounds(canvas);
|
|
11788
11835
|
const old = canvas, { width, height } = trimBounds;
|