Tk Library Source Code

Artifact [e25bf59915]
Login

Artifact e25bf599152ac03ecb04527f7b56b8c80e26e0b4:

Attachment "BWidget-scrollregion-fix.patch" to ticket [3317772fff] added by oehhar 2011-06-23 14:19:03. Also attachment "BWidget-scrollregion-fix.patch" to ticket [3317772fff] added by oehhar 2011-06-23 14:17:57.
diff -ur BWidget-1.9.4-prev/listbox.tcl BWidget-1.9.4/listbox.tcl
--- BWidget-1.9.4-prev/listbox.tcl	2011-06-17 14:37:48.000000000 +0200
+++ BWidget-1.9.4/listbox.tcl	2011-06-17 14:36:31.000000000 +0200
@@ -963,9 +963,11 @@
     set bd   [expr {2*($bd + $ht)}]
     set w    [expr {[winfo width  $path] - $bd}]
     set h    [expr {[winfo height $path] - $bd}]
-    set xinc [$path.c cget -xscrollincrement]
-    set yinc [$path.c cget -yscrollincrement]
+    set xinc [expr {int([$path.c cget -xscrollincrement])}]
+    set yinc [expr {int([$path.c cget -yscrollincrement])}]
     set bbox [$path.c bbox item win img]
+    set ow   $w
+    set oh   $h
     if { [llength $bbox] } {
         set xs [lindex $bbox 2]
         set ys [lindex $bbox 3]
@@ -975,12 +977,18 @@
             if { [set r [expr {$w % $xinc}]] } {
                 set w [expr {$w+$xinc-$r}]
             }
+            if { [set diff [expr {$ow % $xinc}]] } {
+                incr w $diff
+            }
         }
         if { $h < $ys } {
             set h [expr {int($ys)}]
             if { [set r [expr {$h % $yinc}]] } {
                 set h [expr {$h+$yinc-$r}]
             }
+            if { [set diff [expr {$oh % $yinc}]] } {
+                incr h $diff
+            }
         }
     }
 
diff -ur BWidget-1.9.4-prev/tree.tcl BWidget-1.9.4/tree.tcl
--- BWidget-1.9.4-prev/tree.tcl	2010-12-14 22:24:16.000000000 +0100
+++ BWidget-1.9.4/tree.tcl	2011-06-17 14:36:34.000000000 +0200
@@ -1221,9 +1221,11 @@
     set bd   [expr {2*([$path.c cget -borderwidth]+[$path.c cget -highlightthickness])}]
     set w    [expr {[winfo width  $path] - $bd}]
     set h    [expr {[winfo height $path] - $bd}]
-    set xinc [$path.c cget -xscrollincrement]
-    set yinc [$path.c cget -yscrollincrement]
+    set xinc [expr {int([$path.c cget -xscrollincrement])}]
+    set yinc [expr {int([$path.c cget -yscrollincrement])}]
     set bbox [$path.c bbox node]
+    set ow   $w
+    set oh   $h
     if { [llength $bbox] } {
         set xs [lindex $bbox 2]
         set ys [lindex $bbox 3]
@@ -1233,12 +1235,18 @@
             if { [set r [expr {$w % $xinc}]] } {
                 set w [expr {$w+$xinc-$r}]
             }
+            if { [set diff [expr {$ow % $xinc}]] } {
+                incr w $diff
+            }
         }
         if { $h < $ys } {
             set h [expr {int($ys)}]
             if { [set r [expr {$h % $yinc}]] } {
                 set h [expr {$h+$yinc-$r}]
             }
+            if { [set diff [expr {$oh % $yinc}]] } {
+                incr h $diff
+            }
         }
     }