mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Fix pin not respected by multi-select move (#284)
This commit is contained in:
@@ -2444,7 +2444,7 @@ export class LGraphCanvas {
|
|||||||
this.#dirty()
|
this.#dirty()
|
||||||
|
|
||||||
function addToSetRecursively(item: Positionable, items: Set<Positionable>): void {
|
function addToSetRecursively(item: Positionable, items: Set<Positionable>): void {
|
||||||
if (items.has(item)) return
|
if (items.has(item) || item.pinned) return
|
||||||
items.add(item)
|
items.add(item)
|
||||||
item.children?.forEach(x => addToSetRecursively(x, items))
|
item.children?.forEach(x => addToSetRecursively(x, items))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1437,6 +1437,8 @@ export class LGraphNode implements Positionable, IPinnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
move(deltaX: number, deltaY: number): void {
|
move(deltaX: number, deltaY: number): void {
|
||||||
|
if (this.pinned) return
|
||||||
|
|
||||||
this.pos[0] += deltaX
|
this.pos[0] += deltaX
|
||||||
this.pos[1] += deltaY
|
this.pos[1] += deltaY
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ export interface Positionable {
|
|||||||
/** true if this object is part of the selection, otherwise false. */
|
/** true if this object is part of the selection, otherwise false. */
|
||||||
selected?: boolean
|
selected?: boolean
|
||||||
|
|
||||||
|
/** See {@link IPinnable.pinned} */
|
||||||
|
readonly pinned?: boolean
|
||||||
|
|
||||||
readonly children?: ReadonlySet<Positionable>
|
readonly children?: ReadonlySet<Positionable>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user