[PD-cvs] pd/src desire.tk,1.1.2.600.2.367,1.1.2.600.2.368

chunlee chunlee at users.sourceforge.net
Tue Aug 14 10:03:49 CEST 2007


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

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
grid improved


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.367
retrieving revision 1.1.2.600.2.368
diff -C2 -d -r1.1.2.600.2.367 -r1.1.2.600.2.368
*** desire.tk	14 Aug 2007 07:28:12 -0000	1.1.2.600.2.367
--- desire.tk	14 Aug 2007 08:03:44 -0000	1.1.2.600.2.368
***************
*** 1912,1916 ****
  def Canvas auto_scrollbars {} {
  	set c [$self widget]
- 	puts ">>> [$c bbox foo]"
  	if {[$c bbox foo] != ""} {
  		mset {cx1 cy1 cx2 cy2} [$c bbox foo]
--- 1912,1915 ----
***************
*** 1921,1925 ****
  	set y2 [$c canvasy [winfo height $c]]
  	if {$x2 == 1} {set x2 $cx2; set y2 $cy2}
- 	puts "cx $cx2 cy $cy2 x2 $x2 y2 $y2"
  	if {$cx2 <= $x2 && $cy2 <= $y2} {$self remove_scrollbars} {$self init_scrollbars}
  }
--- 1920,1923 ----
***************
*** 6624,6627 ****
--- 6622,6626 ----
  	set @size [$@canvas look grid_size]
  	set @col [$@canvas look grid]
+ 	set @gap 5
  }
  
***************
*** 6650,6668 ****
  	set x2 [expr $x1+$@width]; set y2 [expr $y1+$@height]
  	set zoom [$@canvas zoom]
! 	set z [expr 1/$zoom]
! 	for {set i [expr int($x1*$z)]} {$i < $x2*$z} {incr i} {
! 		if {![expr $i % $@size]} {
! 			set line [list $i -1000 $i [expr $y2*$z]]
! 			$self item HL$i line $line -fill $@col -width 0.1 -dash {2 2 2 2}
! 		}
! 	}
! 	for {set i [expr int($y1*$z)]} {$i < $y2*$z} {incr i} {
  		if {![expr $i % int($@size)]} {
! 			set line [list -1000 $i [expr $x2*$z] $i]
! 			$self item VL$i line $line -fill $@col -width 0.1 -dash {2 2 2 2}
  		}
  	}
  
- 	$c lower $self $lowest
  }
  
--- 6649,6671 ----
  	set x2 [expr $x1+$@width]; set y2 [expr $y1+$@height]
  	set zoom [$@canvas zoom]
! 	$self draw_lines $x1 $x2 $y2 HL
! 	$self draw_lines $y1 $y2 $x2 VL
! 	$c lower $self $lowest
! }
! 
! def Grid draw_lines {v1 v2 v3 tag} {
! 	set z [expr 1/[$@canvas zoom]]; set l 0; set g $@gap
! 	for {set i [expr int($v1*$z)]} {$i < $v2*$z} {incr i} {
! 		if {$l%$g == $g-1} {set width 1;set dash [list 7 1]} {set width 1;set dash [list 4 4 4 4]}
  		if {![expr $i % int($@size)]} {
! 			switch $tag {
! 				HL {set line [list $i -1000 $i [expr $v3*$z]]}
! 				VL {set line [list -1000 $i [expr $v3*$z] $i]}
! 			}
! 			$self item ${tag}$i line $line -fill $@col -width $width -dash $dash
! 			incr l
  		}
  	}
  
  }
  





More information about the Pd-cvs mailing list