[PD-cvs] pd/src desire.tk,1.1.2.387,1.1.2.388

chunlee chunlee at users.sourceforge.net
Mon Aug 21 00:50:55 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
crosshair trouble..


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.387
retrieving revision 1.1.2.388
diff -C2 -d -r1.1.2.387 -r1.1.2.388
*** desire.tk	20 Aug 2006 22:38:55 -0000	1.1.2.387
--- desire.tk	20 Aug 2006 22:50:52 -0000	1.1.2.388
***************
*** 4367,4370 ****
--- 4367,4408 ----
  	mset {vx1 vx2} [$c xview]
  	mset {vy1 vy2} [$c yview]
+ 	set xoff [expr ([winfo width $c] * $vx1)/$@scale]
+ 	set yoff [expr ([winfo height $c] * $vy1)/$@scale]
+ 	set vx1 [expr ($x1+($x2-$x1)*$vx1)/$@scale]
+ 	set vy1 [expr ($y1+($y2-$y1)*$vy1)/$@scale]
+ 	set vx2 [expr ($x1+($x2-$x1)*$vx2)/$@scale]
+ 	set vy2 [expr ($y1+($y2-$y1)*$vy2)/$@scale]
+ 	mset {type id detail} $target
+ 	if {$crosshair(hairsnap)} {
+ 	  switch -regexp -- $type {
+ 	    ^object|outlet|inlet$ {
+ 		if {$id != $self} {
+ 			mset {x y x3 y3} [$id bbox]
+ 			set crosshair(follow) $id
+ 		}
+ 	    }
+ 	    ^move|edit$ {mset {x y x3 y3} [$crosshair(follow) bbox]}
+ 	  }
+ 	}
+ 	#set v1 [list $x $vy1 $x $vy2]
+ 	#set h1 [list $vx1 $y $vx2 $y]
+ 	set v1 [list $x [expr $y - $y + $yoff] $x [expr $y + ($height +$yoff)]]
+ 	set h1 [list [expr $x - $x + $xoff] $y [expr $x + ($width +$xoff)] $y]
+ 	#$self item BORDER rect [list $vx1 $vy1 $vx2 $vy2] -width 10
+ 	$self item VHAIR1 line $v1 -fill [look selectframe] -width 0.5 -dash {4 4 4 4}
+ 	$self item HHAIR1 line $h1 -fill [look selectframe] -width 0.5 -dash {4 4 4 4}
+ }
+ 
+ 
+ def Canvas show_crosshair2 {x y target} {
+ 	global crosshair
+ 	set c .$self.c
+ 	set width  [expr [winfo  width $c]/$@scale]
+ 	set height [expr [winfo height $c]/$@scale]
+ 	mset {x1 y1 x2 y2} [$c cget -scrollregion]
+ 	mset {vx1 vx2} [$c xview]
+ 	mset {vy1 vy2} [$c yview]
+ 	#set xoff [expr ([winfo width $c] * $vx1)/$@scale]
+ 	#set yoff [expr ([winfo height $c] * $vy1)/$@scale]
  	set vx1 [expr ($x1+($x2-$x1)*$vx1)/$@scale]
  	set vy1 [expr ($y1+($y2-$y1)*$vy1)/$@scale]
***************
*** 4385,4388 ****
--- 4423,4428 ----
  	set v1 [list $x $vy1 $x $vy2]
  	set h1 [list $vx1 $y $vx2 $y]
+ 	#set v1 [list $x [expr $y - $y + $yoff] $x [expr $y + ($height +$yoff)]]
+ 	#set h1 [list [expr $x - $x + $xoff] $y [expr $x + ($width +$xoff)] $y]
  	#$self item BORDER rect [list $vx1 $vy1 $vx2 $vy2] -width 10
  	$self item VHAIR1 line $v1 -fill [look selectframe] -width 0.5 -dash {4 4 4 4}
***************
*** 4390,4393 ****
--- 4430,4434 ----
  }
  
+ 
  def Canvas hide_crosshair {} {$self item_delete VHAIR1; $self item_delete HHAIR1}
  





More information about the Pd-cvs mailing list