@dreamboard-games/sdk 0.5.0-alpha.10 → 0.5.0-alpha.11
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/{chunk-34IGUWOP.js → chunk-2IGXAYW4.js} +10 -2
- package/dist/{chunk-34IGUWOP.js.map → chunk-2IGXAYW4.js.map} +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +2 -0
- package/dist/react.js +92 -25
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
|
@@ -1682,6 +1682,13 @@ function createGestureRecognizer(down, callbacks, options = {}) {
|
|
|
1682
1682
|
}
|
|
1683
1683
|
};
|
|
1684
1684
|
}
|
|
1685
|
+
function magneticDropPoint(point, box, retained, coarse) {
|
|
1686
|
+
const radius = coarse ? retained ? 52 : 28 : retained ? 36 : 18;
|
|
1687
|
+
if (box.width <= 0 || box.height <= 0) return null;
|
|
1688
|
+
const x = Math.max(box.x, Math.min(point.x, box.x + box.width));
|
|
1689
|
+
const y = Math.max(box.y, Math.min(point.y, box.y + box.height));
|
|
1690
|
+
return Math.hypot(point.x - x, point.y - y) <= radius ? { x, y } : null;
|
|
1691
|
+
}
|
|
1685
1692
|
|
|
1686
1693
|
// src/headless/drop-targets.ts
|
|
1687
1694
|
function isSameDropTarget(left, right) {
|
|
@@ -1698,6 +1705,7 @@ export {
|
|
|
1698
1705
|
createGameInstance,
|
|
1699
1706
|
isSameDropTarget,
|
|
1700
1707
|
GESTURE_THRESHOLDS,
|
|
1701
|
-
createGestureRecognizer
|
|
1708
|
+
createGestureRecognizer,
|
|
1709
|
+
magneticDropPoint
|
|
1702
1710
|
};
|
|
1703
|
-
//# sourceMappingURL=chunk-
|
|
1711
|
+
//# sourceMappingURL=chunk-2IGXAYW4.js.map
|