diff options
author | csaba <csaba> | 2024-06-22 15:10:55 (GMT) |
---|---|---|
committer | csaba <csaba> | 2024-06-22 15:10:55 (GMT) |
commit | 7c3e2ff815e23cc6ac1ce9891ca659e709776ea4 (patch) | |
tree | 82b9528e7478b80a60eaa8ebd4c730e70c74e772 /library/tk.tcl | |
parent | 86129d02d64e51b5ccdc92e3f9317842a6eadf0a (diff) | |
parent | d5d68cc968cfeb0349723c6d43a0613753b476e9 (diff) | |
download | tk-7c3e2ff815e23cc6ac1ce9891ca659e709776ea4.zip tk-7c3e2ff815e23cc6ac1ce9891ca659e709776ea4.tar.gz tk-7c3e2ff815e23cc6ac1ce9891ca659e709776ea4.tar.bz2 |
Some more cleanup, mainly in the Widget Demo.
Diffstat (limited to 'library/tk.tcl')
-rw-r--r-- | library/tk.tcl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/library/tk.tcl b/library/tk.tcl index 32f8b31..7741fd0 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -562,14 +562,12 @@ proc ::tk::PreciseScrollDeltas {dxdy} { ## yview moveto. proc ::tk::ScrollByPixels {w deltaX deltaY} { + set fracX [lindex [$w xview] 0] + set fracY [lindex [$w yview] 0] 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}] - set y [expr {$Y - $deltaY / $height}] - $w xview moveto $x - $w yview moveto $y + $w xview moveto [expr {$fracX - $deltaX / $width}] + $w yview moveto [expr {$fracY - $deltaY / $height}] } # ::tk::TabToWindow -- |