@meta2d/core 1.1.4 → 1.1.5
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/package.json +1 -1
- package/src/canvas/canvas.js +5 -3
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.js +26 -9
- package/src/core.js.map +1 -1
- package/src/pen/model.d.ts +1 -0
- package/src/pen/model.js.map +1 -1
- package/src/pen/render.js +2 -1
- package/src/pen/render.js.map +1 -1
- package/src/store/store.js +2 -1
- package/src/store/store.js.map +1 -1
- package/src/tooltip/tooltip.js +3 -0
- package/src/tooltip/tooltip.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -1390,6 +1390,7 @@ export class Canvas {
|
|
|
1390
1390
|
buttons: 1,
|
|
1391
1391
|
});
|
|
1392
1392
|
if (e.touches.length === 2) {
|
|
1393
|
+
this.mouseDown = undefined;
|
|
1393
1394
|
this.initTouchDis = Math.hypot(e.touches[0].pageX - e.touches[1].pageX, e.touches[0].pageY - e.touches[1].pageY);
|
|
1394
1395
|
this.initScale = this.store.data.scale;
|
|
1395
1396
|
this.startTouches = e.touches;
|
|
@@ -1457,16 +1458,17 @@ export class Canvas {
|
|
|
1457
1458
|
});
|
|
1458
1459
|
}
|
|
1459
1460
|
else if (len === 2 && this.startTouches?.length === 2) {
|
|
1461
|
+
this.mouseDown = undefined;
|
|
1460
1462
|
if (!this.touchMoving && !this.touchScaling) {
|
|
1461
1463
|
const x1 = this.startTouches[0].pageX - touches[0].pageX;
|
|
1462
1464
|
const x2 = this.startTouches[1].pageX - touches[1].pageX;
|
|
1463
1465
|
const y1 = this.startTouches[0].pageY - touches[0].pageY;
|
|
1464
1466
|
const y2 = this.startTouches[1].pageY - touches[1].pageY;
|
|
1465
|
-
if (((x1 >= 0 && x2 < 0) || (x1 <= 0 && x2 > 0)) &&
|
|
1466
|
-
((y1 >= 0 && y2 < 0) || (y1 <= 0 && y2 > 0))) {
|
|
1467
|
+
if ((((x1 >= 0 && x2 < 0) || (x1 <= 0 && x2 > 0)) &&
|
|
1468
|
+
((y1 >= 0 && y2 < 0) || (y1 <= 0 && y2 > 0))) || (x2 == 0 && y2 == 0) || (x1 == 0 && y1 == 0)) {
|
|
1467
1469
|
this.touchScaling = true;
|
|
1468
1470
|
}
|
|
1469
|
-
else {
|
|
1471
|
+
else if (y1 * y2 > 0 && x1 * x2 > 0) {
|
|
1470
1472
|
this.touchMoving = true;
|
|
1471
1473
|
}
|
|
1472
1474
|
}
|