[PD-cvs] pd/src desire.tk,1.1.2.338,1.1.2.339

Mathieu Bouchard matju at users.sourceforge.net
Tue Aug 15 05:21:56 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
wire move fix. also added Canvas selection-= selection_wire-=


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.338
retrieving revision 1.1.2.339
diff -C2 -d -r1.1.2.338 -r1.1.2.339
*** desire.tk	15 Aug 2006 02:19:20 -0000	1.1.2.338
--- desire.tk	15 Aug 2006 03:21:53 -0000	1.1.2.339
***************
*** 1062,1065 ****
--- 1062,1066 ----
  # give topleft point of an object in the canvas it's rendered in.
  # this includes GOP and excludes zoom.
+ # inheritance problem: this doesn't work for Wire, which doesn't store its positions
  def View xy {} {
  	# todo: should compute GOP stuff here
***************
*** 1663,1669 ****
  }
  def Canvas selection+= {objs} {
! 	set @selection [concat [lwithout $@selection $objs] $objs]
  	foreach o $objs {$o selected?= 1}
  }
  
  def Canvas selection_wire {} {return $@selection_wire}
--- 1664,1674 ----
  }
  def Canvas selection+= {objs} {
! 	set @selection [concat $@selection [lwithout $objs $@selection]]
  	foreach o $objs {$o selected?= 1}
  }
+ def Canvas selection-= {objs} {
+ 	set @selection [lwithout $@selection $objs]
+ 	foreach o $objs {$o selected?= 0}
+ }
  
  def Canvas selection_wire {} {return $@selection_wire}
***************
*** 1674,1680 ****
  }
  def Canvas selection_wire+= {wires} {
! 	set @selection_wire [concat [lwithout $@selection_wire $wires] $wires]
  	foreach o $wires {$o selected?= 1}
  }
  
  def ObjectBox draw_box {} {
--- 1679,1689 ----
  }
  def Canvas selection_wire+= {wires} {
! 	set @selection_wire [concat $@selection_wire [lwithout $wires $@selection_wire]]
  	foreach o $wires {$o selected?= 1}
  }
+ def Canvas selection_wire-= {wires} {
+ 	set @selection_wire [lwithout $@selection_wire $wires]
+ 	foreach o $wires {$o selected?= 0}
+ }
  
  def ObjectBox draw_box {} {
***************
*** 1830,1845 ****
  def View position= {xy1} {mset [list @x1 @y1] $xy1}
  
  def View move {dx dy} {
  	mset {x y} [$self xy]
  	set @x1 [expr $@x1+$dx]
  	set @y1 [expr $@y1+$dy]
! 	#mset {u v} [$self xy]
! 	#.$@canvas.c move $self [expr $u-$x] [expr $v-$y]
! 	.$@canvas.c move $self $dx $dy
  	$self draw_wires
  }
  
- def View draw_wires {} {foreach wire $_($@canvas:wires) {$wire draw}}
- 
  def* View set_orig_xy {x y} {
  	set @orig_x $x
--- 1839,1853 ----
  def View position= {xy1} {mset [list @x1 @y1] $xy1}
  
+ #!@#$ contains Box-specific code.
  def View move {dx dy} {
  	mset {x y} [$self xy]
  	set @x1 [expr $@x1+$dx]
  	set @y1 [expr $@y1+$dy]
! 	set scale [$@canvas scale]
! 	#.$@canvas.c move $self [expr $dx*$scale] [expr $dy*$scale]
! 	$self changed ;# until we find a way to avoid rounding errors on .$@canvas.c move.
  	$self draw_wires
  }
  
  def* View set_orig_xy {x y} {
  	set @orig_x $x
***************
*** 2315,2318 ****
--- 2323,2327 ----
  	set objs $@selection
   	$@history add [list $self undomove $objs]
+ 	set @action none
        }
        none {}
***************
*** 2678,2681 ****
--- 2687,2692 ----
  }
  
+ def Box draw_wires {} {foreach wire $@wires {$wire draw}}
+ 
  def* Box delete_wire {wire} {
    set find [lsearch $@wires $wire]
***************
*** 2752,2755 ****
--- 2763,2769 ----
  def Wire  inlet {} {return $@port2}
  
+ def View draw_wires {} {foreach wire $_($@canvas:wires) {$wire draw}}
+ def Wire move {dx dy} {$self changed}
+ 
  def Wire bbox {} {
  	set obj1 $@obj1





More information about the Pd-cvs mailing list