diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-29 20:56:57 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-29 20:56:57 (GMT) |
commit | c565a681f168cebaa8baa802a1e4db8768930a19 (patch) | |
tree | 7f699128e2c7c2286779a8e730925ffaf66bcd15 /library/iconlist.tcl | |
parent | caef2172285e034b093da4e78c0c57d58e3e1ffe (diff) | |
download | tk-c565a681f168cebaa8baa802a1e4db8768930a19.zip tk-c565a681f168cebaa8baa802a1e4db8768930a19.tar.gz tk-c565a681f168cebaa8baa802a1e4db8768930a19.tar.bz2 |
On Windows, make sure that mousewheel rounding is the same in positive as in negative direction, for all bindings (was already done for text widget)
Diffstat (limited to 'library/iconlist.tcl')
-rw-r--r-- | library/iconlist.tcl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/library/iconlist.tcl b/library/iconlist.tcl index 30352a1..2095ad6 100644 --- a/library/iconlist.tcl +++ b/library/iconlist.tcl @@ -509,6 +509,12 @@ package require Tk 8.6 if {$noScroll || $::tk_strictMotif} { return } + # We must make sure that positive and negative movements are rounded + # equally to integers, avoiding the problem that + # (int)1/120 = 0, + # but + # (int)-1/120 = -1 + # The following code ensure equal +/- behaviour. if {$amount > 0} { $canvas xview scroll [expr {(-119-$amount) / 120}] units } else { |