@@ -10,6 +10,7 @@ import type {
1010} from '@/lib/litegraph/src/litegraph'
1111import type { Rect } from '@/lib/litegraph/src/interfaces'
1212import { layoutStore } from '@/renderer/core/layout/store/layoutStore'
13+ import { LayoutSource } from '@/renderer/core/layout/types'
1314import type { LGraphCanvas } from '@/lib/litegraph/src/LGraphCanvas'
1415import type { CanvasPointerEvent } from '@/lib/litegraph/src/types/events'
1516import { BaseWidget } from '@/lib/litegraph/src/widgets/BaseWidget'
@@ -880,12 +881,16 @@ describe('layout geometry projection', () => {
880881 const graph = new LGraph ( )
881882 const node = new LGraphNode ( 'test' )
882883 graph . add ( node )
883- layoutStore . batchUpdateNodeBounds ( graph . rootGraph . id , [
884- {
885- nodeId : node . id ,
886- bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
887- }
888- ] )
884+ layoutStore . batchUpdateNodeBounds (
885+ graph . rootGraph . id ,
886+ [
887+ {
888+ nodeId : node . id ,
889+ bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
890+ }
891+ ] ,
892+ { source : LayoutSource . Canvas }
893+ )
889894
890895 node . move ( 5 , 10 )
891896
@@ -898,12 +903,16 @@ describe('layout geometry projection', () => {
898903 const graph = new LGraph ( )
899904 const node = new LGraphNode ( 'test' )
900905 graph . add ( node )
901- layoutStore . batchUpdateNodeBounds ( graph . rootGraph . id , [
902- {
903- nodeId : node . id ,
904- bounds : { x : 103 , y : 97 , width : 200 , height : 80 }
905- }
906- ] )
906+ layoutStore . batchUpdateNodeBounds (
907+ graph . rootGraph . id ,
908+ [
909+ {
910+ nodeId : node . id ,
911+ bounds : { x : 103 , y : 97 , width : 200 , height : 80 }
912+ }
913+ ] ,
914+ { source : LayoutSource . Canvas }
915+ )
907916
908917 node . snapToGrid ( 20 )
909918
@@ -916,12 +925,16 @@ describe('layout geometry projection', () => {
916925 const graph = new LGraph ( )
917926 const node = new LGraphNode ( 'test' )
918927 graph . add ( node )
919- layoutStore . batchUpdateNodeBounds ( graph . rootGraph . id , [
920- {
921- nodeId : node . id ,
922- bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
923- }
924- ] )
928+ layoutStore . batchUpdateNodeBounds (
929+ graph . rootGraph . id ,
930+ [
931+ {
932+ nodeId : node . id ,
933+ bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
934+ }
935+ ] ,
936+ { source : LayoutSource . Canvas }
937+ )
925938
926939 graph . remove ( node )
927940 graph . add ( node )
@@ -943,12 +956,16 @@ describe('layout geometry projection', () => {
943956 const pos = node . pos
944957 const size = node . size
945958
946- layoutStore . batchUpdateNodeBounds ( graph . rootGraph . id , [
947- {
948- nodeId : node . id ,
949- bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
950- }
951- ] )
959+ layoutStore . batchUpdateNodeBounds (
960+ graph . rootGraph . id ,
961+ [
962+ {
963+ nodeId : node . id ,
964+ bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
965+ }
966+ ] ,
967+ { source : LayoutSource . Canvas }
968+ )
952969 pos [ 0 ] = 50
953970 size [ 1 ] = 90
954971
@@ -970,12 +987,16 @@ describe('layout geometry projection', () => {
970987 node . pos = [ 10 , 20 ]
971988 node . size = [ 100 , 50 ]
972989 graph . add ( node )
973- layoutStore . batchUpdateNodeBounds ( graph . rootGraph . id , [
974- {
975- nodeId : node . id ,
976- bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
977- }
978- ] )
990+ layoutStore . batchUpdateNodeBounds (
991+ graph . rootGraph . id ,
992+ [
993+ {
994+ nodeId : node . id ,
995+ bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
996+ }
997+ ] ,
998+ { source : LayoutSource . Canvas }
999+ )
9791000
9801001 node . pos = [ 50 , 60 ]
9811002
@@ -988,12 +1009,16 @@ describe('layout geometry projection', () => {
9881009 node . pos = [ 10 , 20 ]
9891010 node . size = [ 100 , 50 ]
9901011 graph . add ( node )
991- layoutStore . batchUpdateNodeBounds ( graph . rootGraph . id , [
992- {
993- nodeId : node . id ,
994- bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
995- }
996- ] )
1012+ layoutStore . batchUpdateNodeBounds (
1013+ graph . rootGraph . id ,
1014+ [
1015+ {
1016+ nodeId : node . id ,
1017+ bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
1018+ }
1019+ ] ,
1020+ { source : LayoutSource . Canvas }
1021+ )
9971022
9981023 node . size = [ 300 , 90 ]
9991024
@@ -1006,12 +1031,16 @@ describe('layout geometry projection', () => {
10061031 node . pos = [ 10 , 20 ]
10071032 node . size = [ 100 , 50 ]
10081033 graph . add ( node )
1009- layoutStore . batchUpdateNodeBounds ( graph . rootGraph . id , [
1010- {
1011- nodeId : node . id ,
1012- bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
1013- }
1014- ] )
1034+ layoutStore . batchUpdateNodeBounds (
1035+ graph . rootGraph . id ,
1036+ [
1037+ {
1038+ nodeId : node . id ,
1039+ bounds : { x : 30 , y : 40 , width : 200 , height : 80 }
1040+ }
1041+ ] ,
1042+ { source : LayoutSource . Canvas }
1043+ )
10151044
10161045 node . pos = [ 50 , 60 ]
10171046 node . setSize ( [ node . size [ 0 ] , 120 ] )
0 commit comments