Prevent dragging of selected locked nodes
This commit is contained in:
parent
728790f73c
commit
de1faa00df
@ -191,6 +191,8 @@ function Note({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const noteName = `note${note.locked ? "-locked" : ""}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<animated.Group
|
<animated.Group
|
||||||
{...props}
|
{...props}
|
||||||
@ -212,6 +214,7 @@ function Note({
|
|||||||
onMouseEnter={handlePointerEnter}
|
onMouseEnter={handlePointerEnter}
|
||||||
onMouseLeave={handlePointerLeave}
|
onMouseLeave={handlePointerLeave}
|
||||||
opacity={note.visible ? noteOpacity : 0.5}
|
opacity={note.visible ? noteOpacity : 0.5}
|
||||||
|
name={noteName}
|
||||||
>
|
>
|
||||||
{!note.textOnly && (
|
{!note.textOnly && (
|
||||||
<Rect
|
<Rect
|
||||||
|
@ -69,7 +69,8 @@ function Selection({
|
|||||||
if (stage) {
|
if (stage) {
|
||||||
for (let item of selection.items) {
|
for (let item of selection.items) {
|
||||||
const node = stage.findOne(`#${item.id}`);
|
const node = stage.findOne(`#${item.id}`);
|
||||||
if (node) {
|
// Don't drag locked nodes
|
||||||
|
if (node && !node.name().endsWith("-locked")) {
|
||||||
intersectingNodesRef.current.push({
|
intersectingNodesRef.current.push({
|
||||||
...item,
|
...item,
|
||||||
node,
|
node,
|
||||||
|
Loading…
Reference in New Issue
Block a user