From ed578c27c821a146ca684137d5eb1ac986858599 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Jan 2010 11:24:42 +0000 Subject: patch [#20690] Cut Linking for Logic Bricks from Dalai Felinto (dfelinto) cutting kinks now works the same as in the node editor. --- source/blender/editors/interface/interface.c | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'source/blender/editors/interface/interface.c') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 72502dd018f..48fd23ad0e7 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -942,7 +942,42 @@ void uiBlockClearButLock(uiBlock *block) /* *************************************************************** */ +void ui_delete_linkline(uiLinkLine *line, uiBut *but) +{ + uiLink *link; + int a, b; + + BLI_remlink(&but->link->lines, line); + + link= line->from->link; + + /* are there more pointers allowed? */ + if(link->ppoin) { + + if(*(link->totlink)==1) { + *(link->totlink)= 0; + MEM_freeN(*(link->ppoin)); + *(link->ppoin)= NULL; + } + else { + b= 0; + for(a=0; a< (*(link->totlink)); a++) { + + if( (*(link->ppoin))[a] != line->to->poin ) { + (*(link->ppoin))[b]= (*(link->ppoin))[a]; + b++; + } + } + (*(link->totlink))--; + } + } + else { + *(link->poin)= NULL; + } + MEM_freeN(line); + //REDRAW +} /* XXX 2.50 no links supported yet */ #if 0 static void ui_delete_active_linkline(uiBlock *block) -- cgit v1.2.3