summaryrefslogtreecommitdiffstats
path: root/library/tk.tcl
diff options
context:
space:
mode:
authorcsaba <csaba>2024-06-20 16:02:27 (GMT)
committercsaba <csaba>2024-06-20 16:02:27 (GMT)
commit7226ff83d32f6b1c5ec1737bfdf3de80881d72ba (patch)
tree7dc7fe46a60f136ca810ccaff3289febcf8730e2 /library/tk.tcl
parent07ac4eea5e2a20778a1f0d1b1cdc9020046dd638 (diff)
parent581a06b7efecf3d1acd01cf774fc1821f16b6b31 (diff)
downloadtk-7226ff83d32f6b1c5ec1737bfdf3de80881d72ba.zip
tk-7226ff83d32f6b1c5ec1737bfdf3de80881d72ba.tar.gz
tk-7226ff83d32f6b1c5ec1737bfdf3de80881d72ba.tar.bz2
Improvements in the proc ::tk::ScrollByPixels.
Diffstat (limited to 'library/tk.tcl')
-rw-r--r--library/tk.tcl8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/tk.tcl b/library/tk.tcl
index f12470f..32f8b31 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -558,12 +558,12 @@ proc ::tk::PreciseScrollDeltas {dxdy} {
return [list $deltaX $deltaY]
}
-# Helper for smooth scrolling of widgets that support xview moveto,
-# yview moveto, height and width.
+## Helper for smooth scrolling of widgets that support xview moveto and
+## yview moveto.
proc ::tk::ScrollByPixels {w deltaX deltaY} {
- set width [expr {1.0 * [$w cget -width]}]
- set height [expr {1.0 * [$w cget -height]}]
+ set width [expr {1.0 * [winfo width $w]}]
+ set height [expr {1.0 * [winfo height $w]}]
set X [lindex [$w xview] 0]
set Y [lindex [$w yview] 0]
set x [expr {$X - $deltaX / $width}]