[PD-cvs] pd/src desire.tk,1.1.2.436,1.1.2.437

chunlee chunlee at users.sourceforge.net
Thu Aug 31 21:14:27 CEST 2006


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29303

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
fixed some wire bugs


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.436
retrieving revision 1.1.2.437
diff -C2 -d -r1.1.2.436 -r1.1.2.437
*** desire.tk	31 Aug 2006 18:20:47 -0000	1.1.2.436
--- desire.tk	31 Aug 2006 19:14:24 -0000	1.1.2.437
***************
*** 952,955 ****
--- 952,956 ----
  	set_fontstring
  }
+ 
  proc read_ddrc_old {} {
  	global cmdline look key
***************
*** 976,979 ****
--- 977,981 ----
  	read_ddrc [file join [file dirname $argh0] "../lib/pd/bin/defaults.ddrc"]
  }
+ read_ddrc
  #-----------------------------------------------------------------------------------#
  set pd_apilist "{ALSA 1}"
***************
*** 1855,1859 ****
  	  }
  	}
- 	puts "wires_pair = $@wires_pair"
  	set born [lwithout $wires $@wires]
  	set born_num [expr [llength $born] - 1]
--- 1857,1860 ----
***************
*** 1864,1868 ****
  		$x canvas= $self
  	}
! 	set dead [lwithout $@wires $wires]; foreach x $dead {
  		$x delete
  		set find [lsearch $@wires_pair $x]
--- 1865,1871 ----
  		$x canvas= $self
  	}
! 	set dead [lwithout $@wires $wires];
! 	puts "dead = $dead"
! 	foreach x $dead {
  		$x delete
  		set find [lsearch $@wires_pair $x]
***************
*** 1883,1887 ****
  		if {$find != -1} {
  			$self disconnect [lindex $@wires_pair [expr $find - 1]]
- 			set @wires_pair [lreplace $@wires_pair [expr $find - 1] $find]
  		}
  		$wire delete
--- 1886,1889 ----
***************
*** 1893,1897 ****
  	  if {$find != -1} {
  	    $self disconnect [lindex $@wires_pair [expr $find - 1]]
- 	    set @wires_pair [lreplace $@wires_pair [expr $find - 1] [expr $find - 1]]
  	  }
  	  $x delete
--- 1895,1898 ----
***************
*** 2064,2069 ****
  	      set outs [$id noutlets]
  	      set  ins [$id  ninlets]
! 	      if {$y>=$y2-6 && $outs} {return [list "outlet" $id [expr int(($x-$x1)*$outs/($x2-$x1))]]}
! 	      if {$y< $y1+2 &&  $ins} {return [list  "inlet" $id [expr int(($x-$x1)* $ins/($x2-$x1))]]}
  	      return [list "object" $id]
  	    }
--- 2065,2078 ----
  	      set outs [$id noutlets]
  	      set  ins [$id  ninlets]
! 	      if {$y>=$y2-6 && $outs} {
! 		      set val [expr int(($x-$x1)*$outs/($x2-$x1))]
! 		      if {$val == $outs} {set val [expr $val-1]}
! 		      return [list "outlet" $id $val]
! 	      }
! 	      if {$y< $y1+2 &&  $ins} {
! 		      set val [expr int(($x-$x1)* $ins/($x2-$x1))]
! 		      if {$val == $ins} {set val [expr $val-1]}
! 		      return [list  "inlet" $id $val]
! 	      }
  	      return [list "object" $id]
  	    }
***************
*** 2260,2264 ****
  	mset {from outlet to inlet} $wire; pd .$self disconnect $from $outlet $to $inlet
  	$@history add [list $self    connect $wire]
! 	set @wires_pair [lreplace $@wires_pair [lsearch $@wires_pair $wire] [lsearch $@wires_pair $wire]]
  }
  def Canvas    connect {wire} {
--- 2269,2273 ----
  	mset {from outlet to inlet} $wire; pd .$self disconnect $from $outlet $to $inlet
  	$@history add [list $self    connect $wire]
! 	#set @wires_pair [lreplace $@wires_pair [lsearch $@wires_pair $wire] [lsearch $@wires_pair $wire]]
  }
  def Canvas    connect {wire} {
***************
*** 2319,2330 ****
  	#mset [list type @to @inlet] $target
  	mset [list type foo bar] $target
  	switch $type {
  	outlet {mset [list type @from @outlet] $target}
  	inlet {mset [list type @to @inlet] $target}
  	}
- 	$self draw
- }
- def FutureWire unclick {x y f target} {
- 	$self motion $x $y $f $target
  	if {$@to != ""} {
  		set children [$@canvas children]
--- 2328,2345 ----
  	#mset [list type @to @inlet] $target
  	mset [list type foo bar] $target
+ 	#switch $type {
+ 	#outlet {mset [list type @from @outlet] $target}
+ 	#inlet {mset [list type @to @inlet] $target}
+ 	#}
+ 	#puts "outlet::: $@outlet ||inlet::: $@inlet"
+ 	$self draw
+ }
+ def FutureWire unclick {x y f target} {
+ 	#$self motion $x $y $f $target
+ 	mset [list type foo bar] $target
  	switch $type {
  	outlet {mset [list type @from @outlet] $target}
  	inlet {mset [list type @to @inlet] $target}
  	}
  	if {$@to != ""} {
  		set children [$@canvas children]
***************
*** 2433,2437 ****
  			set d_outlet [distance [list $x $y] [list [expr ($x1+$x2)/2] [expr ($y1+$y2)/2]]]
  			set d_inlet [distance [list $x $y] [list [expr ($x3+$x4)/2] [expr ($y3+$y4)/2]]]
- 			puts "	to outlet:: $d_outlet || to inlet:: $d_inlet"
  			if {$d_outlet > $d_inlet} {
  				set x5 $x1; set y5 $y1
--- 2448,2451 ----
***************
*** 2441,2448 ****
  				set target [list inlet $obj2 $inlet]
  			}
- 			#set target [$self identify_target $x1 $y1 $f]
- 			#target::: outlet x82d7568 0
- 			#set target [$self identify_target $x5 $y5 $f]
- 			#puts "	target::: $target"
  			set @action [FutureWire new $self $x1 $y1 $f $target]
  		}
--- 2455,2458 ----
***************
*** 2515,2523 ****
  def Canvas tab_jump {} {
  	set @keynav 1
- 	#puts "	selection:::: [$self selection]"
- 	#puts "	selection_wire:::: [$self selection_wire]"
- 	#puts "	keynav_current:::: $@keynav_current"
- 	#puts "	keynav_tab_sel:::: $@keynav_tab_sel"
- 	#$self deselect_all
  	set olength [llength $@selection]
  	set wlength [llength $@selection_wire]
--- 2525,2528 ----





More information about the Pd-cvs mailing list