Skip to content

Commit

Permalink
Fix cloning pinned nodes (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythongosssss authored Dec 2, 2024
1 parent 2d6adf4 commit a0b50dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/LGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a0b50dc

Please sign in to comment.