From: ellson Date: Wed, 14 Oct 2009 15:50:40 +0000 (+0000) Subject: fix for API change in TK's canvas for font size X-Git-Tag: LAST_LIBGRAPH~32^2~1656 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48db850fcde0c8cb64808f2e0b61ae7473420726;p=graphviz fix for API change in TK's canvas for font size --- diff --git a/tclpkg/tcldot/demo/doted.tcl b/tclpkg/tcldot/demo/doted.tcl index 76921be44..c8ae84abb 100755 --- a/tclpkg/tcldot/demo/doted.tcl +++ b/tclpkg/tcldot/demo/doted.tcl @@ -501,16 +501,27 @@ proc zoomupdate {c} { set font [$c itemcget $i -font] if {!$fontsize} { set text [$c itemcget $i -text] - set fontsize [lindex $font 1] + if {[llength $font] < 2} { + #new font API + set fontsize [font actual $font -size] + } { + #old font API + set fontsize [lindex $font 1] + } $c addtag _f$fontsize withtag $i $c addtag _t$text withtag $i } # scale font set newsize [expr {int($fontsize * $data(zdepth))}] if {abs($newsize) >= 4} { - $c itemconfigure $i \ - -font [lreplace $font 1 1 $newsize] \ - -text $text + if {[llength $font] < 2} { + #new font api + font configure $font -size $newsize + } { + #old font api + lreplace $font 1 1 $newsize + } + $c itemconfigure $i -font $font -text $text } { # suppress text if too small $c itemconfigure $i -text {}