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