Fix cloning pinned nodes (#364)

This commit is contained in:
pythongosssss
2024-12-02 01:31:12 +00:00
committed by GitHub
parent 2d6adf46e5
commit a0b50dcf15

View File

@@ -2698,10 +2698,10 @@ export class LGraphNode implements Positionable, IPinnable {
* Toggles pinned state if no value is provided.
*/
pin(v?: boolean): void {
this.graph._version++
this.flags.pinned = v === undefined
? !this.flags.pinned
: v
if (this.graph) {
this.graph._version++
}
this.flags.pinned = v ?? !this.flags.pinned
this.resizable = !this.pinned
// Delete the flag if unpinned, so that we don't get unnecessary
// flags.pinned = false in serialized object.