From 8127e09f9917564a0b5da7ace9e8aa64692c7fb6 Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Mon, 15 Dec 2014 09:14:41 -0800 Subject: Fix typo --- content_scripts/vimium.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css index a8ae5583..cdf47d6c 100644 --- a/content_scripts/vimium.css +++ b/content_scripts/vimium.css @@ -4,8 +4,8 @@ * Vimium dialogs. * * The z-indexes of Vimium elements are very large, because we always want them to show on top. Chrome may - * support up to Number.MAX_VALUE, which is approximately 1.7976e+308. We're using 2**31, which is the max value of a singed 32 bit int. - * Let's use try larger valeus if 2**31 empirically isn't large enough. + * support up to Number.MAX_VALUE, which is approximately 1.7976e+308. We're using 2^31, which is the max + * value of a singed 32 bit int. Let's try larger valeus if 2**31 empirically isn't large enough. */ /* -- cgit v1.2.3 From 10e669904f277d66f5ef15743256a59caa01cc15 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 16 Dec 2014 04:22:43 +0000 Subject: Use a tolerance when checking scrolling to fix zoomed scrolls --- content_scripts/scroller.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index 5eb1c5e2..d3716a46 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -39,7 +39,8 @@ performScroll = (element, direction, amount) -> axisName = scrollProperties[direction].axisName before = element[axisName] element[axisName] += amount - element[axisName] == amount + before + scrollChange = element[axisName] - before + Math.abs(scrollChange - amount) <= 4 # At 25% zoom the scroll can be off by as much as 4. # Test whether `element` should be scrolled. E.g. hidden elements should not be scrolled. shouldScroll = (element, direction) -> -- cgit v1.2.3 From 84bca6fb893f41c1c179b71c1c894bdd81b64127 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 16 Dec 2014 08:25:42 +0000 Subject: Fix smooth scrolling, all cases. --- content_scripts/scroller.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'content_scripts') 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) -> -- cgit v1.2.3