[PD-cvs] pd/src desire.tk,1.1.2.397,1.1.2.398

chunlee chunlee at users.sourceforge.net
Wed Aug 23 18:20:57 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
fix to objectbox width when zoomed


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.397
retrieving revision 1.1.2.398
diff -C2 -d -r1.1.2.397 -r1.1.2.398
*** desire.tk	23 Aug 2006 14:39:43 -0000	1.1.2.397
--- desire.tk	23 Aug 2006 16:20:54 -0000	1.1.2.398
***************
*** 1789,1795 ****
  def* TextBox draw {} {
      global font
!     $self update_size
      # "TEXT" is the text label while "text" is the the input text field tk widget
!     super
      mset {x1 y1} [$self xy]
      if {$@edit} {
--- 1789,1795 ----
  def* TextBox draw {} {
      global font
!     #$self update_size
      # "TEXT" is the text label while "text" is the the input text field tk widget
!     #super
      mset {x1 y1} [$self xy]
      if {$@edit} {
***************
*** 1800,1803 ****
--- 1800,1805 ----
  		-font $font(str) -text $@text -fill [$self look fg] -anchor nw
      }
+     $self update_size
+     super
  }
  
***************
*** 1822,1825 ****
--- 1824,1830 ----
  		-bg [.$@canvas.c itemcget ${self}BASE -fill] -borderwidth 0 -highlightthickness 0\
  		-font $font_str -fg [$self look fg]
+ 	#text $t -height 1 -width [expr [string length $@text]+1] -relief flat \
+ 	#	-bg [$self look bg] -borderwidth 0 -highlightthickness 0\
+ 	#	-font $font_str -fg [$self look fg]
  	bind $t <Key>            "$self key %W %x %y %K %A 0"
  	bind $t <Control-Return> "$self key %W %x %y 10 %A 0"
***************
*** 1853,1860 ****
  	set n [string length $@text]
  	set textwidth [expr $font(padx)+$font(width)*($n+$@edit)]
! 	catch {
! 	set n [expr [string length [.$@canvas.c.${self}text get 1.0 1.end]] -1]
! 	mset {x1 y1 w h} [.$@canvas.c.${self}text bbox 1.$n]
! 	set textwidth [expr ($font(padx) + $x1 + ($w * 2)) / [$@canvas scale]]	
  	}
  	#set textwidth [expr $font(padx)+$font(width)*($n+$@edit)]
--- 1858,1871 ----
  	set n [string length $@text]
  	set textwidth [expr $font(padx)+$font(width)*($n+$@edit)]
! 	if {[llength [.$@canvas.c gettags ${self}TEXT]]} {
! 		mset {x1 y1 x2 y2} [.$@canvas.c bbox ${self}TEXT]
! 		set textwidth [expr (($x2 - $x1)/[$@canvas scale])+$font(padx)]
! 	}
! 	if {[llength [.$@canvas.c gettags ${self}text]]} {
! 	#catch {
! 		set n [expr [string length [.$@canvas.c.${self}text get 1.0 1.end]] -1]
! 		mset {x1 y1 w h} [.$@canvas.c.${self}text bbox 1.$n]
! 		set textwidth [expr ($font(padx) + $x1 + ($w * 2)) / [$@canvas scale]]	
! 	#}
  	}
  	#set textwidth [expr $font(padx)+$font(width)*($n+$@edit)]
***************
*** 1910,1915 ****
  }
  
! def* ObjectBox draw_box {} {
!         global font
  	super
  	set xya [$self bbox]
--- 1921,1926 ----
  }
  
! def ObjectBox draw_box {} {
!    	global font
  	super
  	set xya [$self bbox]
***************
*** 1920,1923 ****
--- 1931,1935 ----
  	$self item BASE1 line      $xyb -fill [$self look frame1] -width 1
  	$self item BASE2 line      $xyc -fill [$self look frame2] -width 1
+ 	.$@canvas.c lower ${self}BASE ${self}TEXT
  }
  





More information about the Pd-cvs mailing list