summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2014-11-07 14:22:05 (GMT)
committerdgp <dgp@noemail.net>2014-11-07 14:22:05 (GMT)
commit307c706ffa4d58cfe209249f923239968bca3ead (patch)
tree2b4547b0fdbf3c85aef0cfcb1be9c36279417c24 /library
parente2e95359b0606125e5f46fa8b984f8ad9cc28c0d (diff)
parentaab79cf1d04e71aa8bd840bcf1b5f4c2be1669f5 (diff)
downloadtk-307c706ffa4d58cfe209249f923239968bca3ead.zip
tk-307c706ffa4d58cfe209249f923239968bca3ead.tar.gz
tk-307c706ffa4d58cfe209249f923239968bca3ead.tar.bz2
[3529885] [scale] handle negative resolution properly.
FossilOrigin-Name: 3de6bd3ca45491f8bf5d2ce1a64a62c2929dc9b0
Diffstat (limited to 'library')
-rw-r--r--library/scale.tcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/scale.tcl b/library/scale.tcl
index d9e7d27..fb9b81b 100644
--- a/library/scale.tcl
+++ b/library/scale.tcl
@@ -223,7 +223,13 @@ proc ::tk::ScaleIncrement {w dir big repeat} {
set inc [$w cget -resolution]
}
if {([$w cget -from] > [$w cget -to]) ^ ($dir eq "up")} {
- set inc [expr {-$inc}]
+ if {$inc > 0} {
+ set inc [expr {-$inc}]
+ }
+ } else {
+ if {$inc < 0} {
+ set inc [expr {-$inc}]
+ }
}
$w set [expr {[$w get] + $inc}]