microboard-temp 0.13.55 → 0.13.56

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.
@@ -60923,10 +60923,9 @@ class ForceGraphEngine {
60923
60923
  if (!activeIds.has(item.getId()))
60924
60924
  continue;
60925
60925
  const pos = item.transformation.getTranslation();
60926
- const half = item.physicsHalfExtent;
60927
- const w = half * 2;
60928
- const h2 = half * 2;
60929
- snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + half, cy: pos.y + half, w, h: h2 });
60926
+ const w = Math.max(item.right - item.left, 1);
60927
+ const h2 = Math.max(item.bottom - item.top, 1);
60928
+ snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + w * 0.5, cy: pos.y + h2 * 0.5, w, h: h2 });
60930
60929
  }
60931
60930
  const snap = Array.from(snapMap.values());
60932
60931
  if (snap.length < 1)
package/dist/cjs/index.js CHANGED
@@ -60923,10 +60923,9 @@ class ForceGraphEngine {
60923
60923
  if (!activeIds.has(item.getId()))
60924
60924
  continue;
60925
60925
  const pos = item.transformation.getTranslation();
60926
- const half = item.physicsHalfExtent;
60927
- const w = half * 2;
60928
- const h2 = half * 2;
60929
- snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + half, cy: pos.y + half, w, h: h2 });
60926
+ const w = Math.max(item.right - item.left, 1);
60927
+ const h2 = Math.max(item.bottom - item.top, 1);
60928
+ snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + w * 0.5, cy: pos.y + h2 * 0.5, w, h: h2 });
60930
60929
  }
60931
60930
  const snap = Array.from(snapMap.values());
60932
60931
  if (snap.length < 1)
package/dist/cjs/node.js CHANGED
@@ -63398,10 +63398,9 @@ class ForceGraphEngine {
63398
63398
  if (!activeIds.has(item.getId()))
63399
63399
  continue;
63400
63400
  const pos = item.transformation.getTranslation();
63401
- const half = item.physicsHalfExtent;
63402
- const w = half * 2;
63403
- const h2 = half * 2;
63404
- snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + half, cy: pos.y + half, w, h: h2 });
63401
+ const w = Math.max(item.right - item.left, 1);
63402
+ const h2 = Math.max(item.bottom - item.top, 1);
63403
+ snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + w * 0.5, cy: pos.y + h2 * 0.5, w, h: h2 });
63405
63404
  }
63406
63405
  const snap = Array.from(snapMap.values());
63407
63406
  if (snap.length < 1)
@@ -60666,10 +60666,9 @@ class ForceGraphEngine {
60666
60666
  if (!activeIds.has(item.getId()))
60667
60667
  continue;
60668
60668
  const pos = item.transformation.getTranslation();
60669
- const half = item.physicsHalfExtent;
60670
- const w = half * 2;
60671
- const h2 = half * 2;
60672
- snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + half, cy: pos.y + half, w, h: h2 });
60669
+ const w = Math.max(item.right - item.left, 1);
60670
+ const h2 = Math.max(item.bottom - item.top, 1);
60671
+ snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + w * 0.5, cy: pos.y + h2 * 0.5, w, h: h2 });
60673
60672
  }
60674
60673
  const snap = Array.from(snapMap.values());
60675
60674
  if (snap.length < 1)
package/dist/esm/index.js CHANGED
@@ -60659,10 +60659,9 @@ class ForceGraphEngine {
60659
60659
  if (!activeIds.has(item.getId()))
60660
60660
  continue;
60661
60661
  const pos = item.transformation.getTranslation();
60662
- const half = item.physicsHalfExtent;
60663
- const w = half * 2;
60664
- const h2 = half * 2;
60665
- snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + half, cy: pos.y + half, w, h: h2 });
60662
+ const w = Math.max(item.right - item.left, 1);
60663
+ const h2 = Math.max(item.bottom - item.top, 1);
60664
+ snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + w * 0.5, cy: pos.y + h2 * 0.5, w, h: h2 });
60666
60665
  }
60667
60666
  const snap = Array.from(snapMap.values());
60668
60667
  if (snap.length < 1)
package/dist/esm/node.js CHANGED
@@ -63123,10 +63123,9 @@ class ForceGraphEngine {
63123
63123
  if (!activeIds.has(item.getId()))
63124
63124
  continue;
63125
63125
  const pos = item.transformation.getTranslation();
63126
- const half = item.physicsHalfExtent;
63127
- const w = half * 2;
63128
- const h2 = half * 2;
63129
- snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + half, cy: pos.y + half, w, h: h2 });
63126
+ const w = Math.max(item.right - item.left, 1);
63127
+ const h2 = Math.max(item.bottom - item.top, 1);
63128
+ snapMap.set(item.getId(), { id: item.getId(), cx: pos.x + w * 0.5, cy: pos.y + h2 * 0.5, w, h: h2 });
63130
63129
  }
63131
63130
  const snap = Array.from(snapMap.values());
63132
63131
  if (snap.length < 1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.55",
3
+ "version": "0.13.56",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",