canvu-react 0.4.66 → 0.4.67

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/react.js CHANGED
@@ -9774,15 +9774,26 @@ var VectorViewport = forwardRef(
9774
9774
  if (!cam) return;
9775
9775
  const { worldX, worldY } = screenToWorld(e.clientX, e.clientY);
9776
9776
  const lineHitWorld = 10 / cam.zoom;
9777
+ const cur = effectiveSelectedIdsRef.current;
9777
9778
  const hit = hitTestWorldPoint(resolvedItemsRef.current, worldX, worldY, {
9778
9779
  lineHitWorld,
9779
9780
  ignoreLocked: true
9780
9781
  });
9781
9782
  if (!hit) {
9783
+ const selectedUnlockedItems = cur.map((id) => resolvedItemsRef.current.find((item) => item.id === id)).filter((item) => item != null && !item.locked);
9784
+ if (selectedUnlockedItems.some(
9785
+ (item) => pointInSelectedItemBounds(item, worldX, worldY)
9786
+ )) {
9787
+ setContextMenuState({
9788
+ x: e.clientX,
9789
+ y: e.clientY,
9790
+ itemIds: [...cur]
9791
+ });
9792
+ return;
9793
+ }
9782
9794
  setContextMenuState(null);
9783
9795
  return;
9784
9796
  }
9785
- const cur = effectiveSelectedIdsRef.current;
9786
9797
  let nextIds;
9787
9798
  if (!cur.includes(hit.id)) {
9788
9799
  nextIds = e.shiftKey ? [...cur, hit.id] : [hit.id];