1
function GraphList=ge_do_move_region(GraphList,xc,yc)
3
//Author : Serge Steer 2002
7
[rect,btn]=rubberbox([xc,yc])
8
if btn==2 then ge_enablemenus();return,end
11
[keep,del]=ge_get_nodes_in_rect(GraphList,rect);
13
if ~edited then ge_enablemenus();return,end
17
//get arcs connected to this node
18
karcs=[karcs,find(GraphList.tail==ksel|GraphList.head==ksel)];
22
[nrect,btn]=dragrect(rect)
23
ge_drawarcs(karcs);ge_drawnodes(keep) //erase
24
GraphList.node_x(keep)=GraphList.node_x(keep)-rect(1)+nrect(1);
25
GraphList.node_y(keep)=GraphList.node_y(keep)-rect(2)+nrect(2);
26
ge_drawnodes(keep);ge_drawarcs(karcs) //redraw at the new position
27
ge_add_history(list("move_region",keep,[rect(1)-nrect(1),rect(2)-nrect(2)]))