aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2014-12-16 08:25:42 +0000
committerStephen Blott2014-12-16 08:25:42 +0000
commit84bca6fb893f41c1c179b71c1c894bdd81b64127 (patch)
tree000c95f6373bdd46f56c63603de3ec028426ff76
parent8200cec17975050ea872236136d916488890850e (diff)
downloadvimium-84bca6fb893f41c1c179b71c1c894bdd81b64127.tar.bz2
Fix smooth scrolling, all cases.
-rw-r--r--content_scripts/scroller.coffee5
1 files changed, 2 insertions, 3 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee
index d3716a46..a2617289 100644
--- a/content_scripts/scroller.coffee
+++ b/content_scripts/scroller.coffee
@@ -34,13 +34,12 @@ getDimension = (el, direction, amount) ->
else
amount
-# Perform a scroll. Return true if we successfully scrolled by the requested amount, and false otherwise.
+# Perform a scroll. Return true if we successfully scrolled by any amount, and false otherwise.
performScroll = (element, direction, amount) ->
axisName = scrollProperties[direction].axisName
before = element[axisName]
element[axisName] += amount
- scrollChange = element[axisName] - before
- Math.abs(scrollChange - amount) <= 4 # At 25% zoom the scroll can be off by as much as 4.
+ element[axisName] != before
# Test whether `element` should be scrolled. E.g. hidden elements should not be scrolled.
shouldScroll = (element, direction) ->