diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-06 16:46:17 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-06 16:46:17 (GMT) |
commit | f51d73def011d920a123d35863c79a9c0e253016 (patch) | |
tree | 1f78fc61d8e3622d66f858c2434ba275a56d4e44 /library | |
parent | 5f06b1ef2f60034c966d8b55c20c63b795d18f1c (diff) | |
download | tk-f51d73def011d920a123d35863c79a9c0e253016.zip tk-f51d73def011d920a123d35863c79a9c0e253016.tar.gz tk-f51d73def011d920a123d35863c79a9c0e253016.tar.bz2 |
Fix [12c8dfaa98] and [7e174a300e]: listbox.tcl/scrlbar.tcl: missing improved units computation in mouse wheel bindings
Diffstat (limited to 'library')
-rw-r--r-- | library/listbox.tcl | 12 | ||||
-rw-r--r-- | library/scrlbar.tcl | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl index 2149e10..a094883 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -195,10 +195,18 @@ if {[tk windowingsystem] eq "aqua"} { } } else { bind Listbox <MouseWheel> { - %W yview scroll [expr {-(%D/30)}] units + if {%D >= 0} { + %W yview scroll [expr {-%D/30}] units + } else { + %W yview scroll [expr {(29-%D)/30}] units + } } bind Listbox <Shift-MouseWheel> { - %W xview scroll [expr {-(%D/30)}] units + if {%D >= 0} { + %W xview scroll [expr {-%D/30}] units + } else { + %W xview scroll [expr {(29-%D)/30}] units + } } } diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 65f29ee..a1c4398 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -144,10 +144,18 @@ if {[tk windowingsystem] eq "aqua"} { } } else { bind Scrollbar <MouseWheel> { - tk::ScrollByUnits %W v [expr {-(%D / 30)}] + if {%D >= 0} { + tk::ScrollByUnits %W v [expr {-%D/30}] + } else { + tk::ScrollByUnits %W v [expr {(29-%D)/30}] + } } bind Scrollbar <Shift-MouseWheel> { - tk::ScrollByUnits %W h [expr {-(%D / 30)}] + if {%D >= 0} { + tk::ScrollByUnits %W h [expr {-%D/30}] + } else { + tk::ScrollByUnits %W h [expr {(29-%D)/30}] + } } } |