diff --git a/src/components/LayerTree.vue b/src/components/LayerTree.vue index fb91d8818..cfe6d49dc 100644 --- a/src/components/LayerTree.vue +++ b/src/components/LayerTree.vue @@ -423,10 +423,23 @@ function updateDropTarget(ev: PointerEvent) { @pointerdown.stop @click.stop="toggleNodeLock(item.value.id)" > - + - + diff --git a/src/composables/use-canvas-input.ts b/src/composables/use-canvas-input.ts index ec0e4f745..04832ec37 100644 --- a/src/composables/use-canvas-input.ts +++ b/src/composables/use-canvas-input.ts @@ -336,7 +336,7 @@ export function useCanvasInput( if (store.state.selectedIds.size !== 1) return false const id = [...store.state.selectedIds][0] const node = store.graph.getNode(id) - if (!node) return false + if (!node || node.locked) return false const abs = store.graph.getAbsolutePosition(id) if ( !hitTestCornerRotation( @@ -371,7 +371,7 @@ export function useCanvasInput( function tryStartResize(sx: number, sy: number, cx: number, cy: number): boolean { for (const id of store.state.selectedIds) { const node = store.graph.getNode(id) - if (!node) continue + if (!node || node.locked) continue const abs = store.graph.getAbsolutePosition(id) const handle = hitTestHandle( sx, @@ -477,6 +477,9 @@ export function useCanvasInput( store.select([hit.id], true) } + const allLocked = [...store.state.selectedIds].every((id) => store.graph.getNode(id)?.locked) + if (allLocked) return + const originals = new Map() for (const id of store.state.selectedIds) { const n = store.graph.getNode(id) @@ -778,6 +781,7 @@ export function useCanvasInput( const hits: string[] = [] for (const node of store.graph.getChildren(store.state.currentPageId)) { + if (!node.visible || node.locked) continue if ( node.x + node.width > minX && node.x < maxX &&