File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,21 @@ app.registerExtension({
21
21
name : groupsName ,
22
22
async setup ( ) {
23
23
const getGroupMenuOptions = LGraphCanvas . prototype . getGroupMenuOptions ;
24
- let move = null ;
24
+ const move = { } ;
25
+ app . graph . _groups . forEach ( ( group , index ) => {
26
+ group . id = index ;
27
+ } ) ;
25
28
LGraphCanvas . prototype . getGroupMenuOptions = function ( group ) {
26
29
const menuOptions = getGroupMenuOptions . apply ( this , arguments ) ;
27
30
menuOptions . push (
28
31
null ,
29
- move
32
+ move [ group . id ]
30
33
? {
31
34
content : "Unfreeze" ,
32
35
callback : ( ) => {
33
36
group . recomputeInsideNodes ( ) ;
34
- group . move = move ;
35
- move = null ;
37
+ group . move = move [ group . id ] ;
38
+ move [ group . id ] = null ;
36
39
group . _nodes . forEach ( ( node ) => {
37
40
node . flags . pinned = false ;
38
41
} ) ;
@@ -42,7 +45,7 @@ app.registerExtension({
42
45
content : "Freeze" ,
43
46
callback : ( ) => {
44
47
group . recomputeInsideNodes ( ) ;
45
- move = group . move ;
48
+ move [ group . id ] = group . move ;
46
49
group . move = ( ) => { } ;
47
50
48
51
group . _nodes . forEach ( ( node ) => {
You can’t perform that action at this time.
0 commit comments