@canvas-harness/react 0.1.6 → 0.1.8

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/index.cjs CHANGED
@@ -632,12 +632,8 @@ var useInteractionGesture = (ref, store, tool) => {
632
632
  if (hit?.kind === "body" && "nodeId" in hit) {
633
633
  const node = store.getNode(hit.nodeId);
634
634
  if (node) {
635
- const local = core.worldToNodeLocal(world, node);
636
- const clamped = {
637
- x: Math.max(0, Math.min(node.w, local.x)),
638
- y: Math.max(0, Math.min(node.h, local.y))
639
- };
640
- return { end: { nodeId: node.id, localOffset: clamped }, nodeId: node.id };
635
+ const localOffset = core.projectToNodeBoundary(world, node);
636
+ return { end: { nodeId: node.id, localOffset }, nodeId: node.id };
641
637
  }
642
638
  }
643
639
  return { end: { worldPoint: world }, nodeId: null };