kitchen-simulator 11.23.0 → 11.24.0

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.
@@ -1547,6 +1547,23 @@ export function calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, a
1547
1547
  }
1548
1548
  });
1549
1549
  }
1550
+ if (getSnap === true) {
1551
+ allItemSnap.filter(function (e) {
1552
+ return e.isSnappedLine;
1553
+ }).forEach(function (snap) {
1554
+ var dist = (snap.pos.x - nx) * (snap.pos.x - nx) + (snap.pos.y - ny) * (snap.pos.y - ny);
1555
+ //console.log("dist", snap)
1556
+ if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist < 100) {
1557
+ ndist = dist;
1558
+ nx = snap.pos.x;
1559
+ ny = snap.pos.y;
1560
+ rotRad = snap.rotRad;
1561
+ getSnap = true;
1562
+
1563
+ //console.log("SUCCESS!!!!");
1564
+ }
1565
+ });
1566
+ }
1550
1567
  if (getSnap === false) {
1551
1568
  var nearRect = null;
1552
1569
  var minDist = Infinity;
@@ -1651,6 +1651,23 @@ function calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect,
1651
1651
  }
1652
1652
  });
1653
1653
  }
1654
+ if (getSnap === true) {
1655
+ allItemSnap.filter(function (e) {
1656
+ return e.isSnappedLine;
1657
+ }).forEach(function (snap) {
1658
+ var dist = (snap.pos.x - nx) * (snap.pos.x - nx) + (snap.pos.y - ny) * (snap.pos.y - ny);
1659
+ //console.log("dist", snap)
1660
+ if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist < 100) {
1661
+ ndist = dist;
1662
+ nx = snap.pos.x;
1663
+ ny = snap.pos.y;
1664
+ rotRad = snap.rotRad;
1665
+ getSnap = true;
1666
+
1667
+ //console.log("SUCCESS!!!!");
1668
+ }
1669
+ });
1670
+ }
1654
1671
  if (getSnap === false) {
1655
1672
  var nearRect = null;
1656
1673
  var minDist = Infinity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "11.23.0",
3
+ "version": "11.24.0",
4
4
  "description": "It is a kitchen simulator (self-contained micro-frontend).",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",