Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7945
Modified Files: Tag: devel_0_39 desire.tk Log Message: small wire connect fix using futurewire
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.329 retrieving revision 1.1.2.330 diff -C2 -d -r1.1.2.329 -r1.1.2.330 *** desire.tk 14 Aug 2006 01:03:48 -0000 1.1.2.329 --- desire.tk 14 Aug 2006 11:12:49 -0000 1.1.2.330 *************** *** 2106,2109 **** --- 2106,2111 ---- set @y1 $y1 set @canvas $canvas + set @wire_from {} + set @wire_to {} $self motion $x1 $y1 0 } *************** *** 2112,2116 **** --- 2114,2133 ---- $self motion $x2 $y2 $f post "UNCLICK should happen now" + mset {type id} [$@canvas identify_target $x2 $y2 -1 -1 "unclick"] + if {$type != "wire"} { + mset {obj_x1 obj_y1 obj_x2 obj_y2} [$id bbox] + set ins 0; set ins [$id ninlets] + if {$y2<$obj_y1+6 && $ins} { + set in [expr int(($x2-$obj_x1)*$ins/($obj_x2-$obj_x1))] + set @wire_to [list $id $in] + mset {from outlet} $@wire_from + mset {to inlet} $@wire_to + $@canvas connect [list \ + [lsearch $_($@canvas:children) $from] $outlet \ + [lsearch $_($@canvas:children) $to] $inlet] + } + } $self _delete + } def FutureWire draw {} { *************** *** 2147,2150 **** --- 2164,2168 ---- mset {x1 y1 x2 y2} [$c bbox ${id}o${out}] set @action [FutureWire new $self [expr ($x1+$x2)/2] [expr ($y1+$y2)/2]] + set _($@action:wire_from) [list $id $out] set @wire_from [list $id $out] #click on a outlet with shift