aboutsummaryrefslogtreecommitdiffstats
path: root/linkHints.js
diff options
context:
space:
mode:
authorint32010-04-17 22:48:10 +0000
committerilya2010-04-18 22:00:04 -0700
commit9eef5eda8d0d37bbf75d009c671d15279e61b25e (patch)
treedba913976b6476799fa960441b127a37589a1f81 /linkHints.js
parent7deefa4a220d6349bd1e24957a2c5e5e3cf91486 (diff)
downloadvimium-9eef5eda8d0d37bbf75d009c671d15279e61b25e.tar.bz2
Factor in zoom when eliminating offscreen links
Diffstat (limited to 'linkHints.js')
-rw-r--r--linkHints.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/linkHints.js b/linkHints.js
index 72fcd5c0..6c4fb3d0 100644
--- a/linkHints.js
+++ b/linkHints.js
@@ -77,8 +77,9 @@ function getVisibleClickableElements() {
// Note that getBoundingClientRect() is relative to the viewport
var boundingRect = element.getBoundingClientRect();
// Exclude links which have just a few pixels on screen, because the link hints won't show for them anyway.
- if (boundingRect.bottom <= 4 || boundingRect.top >= window.innerHeight - 4 ||
- boundingRect.left <= 0 || boundingRect.left >= window.innerWidth - 4)
+ var zoomFactor = currentZoomLevel / 100.0;
+ if (boundingRect.bottom <= 4 || boundingRect.top * zoomFactor >= window.innerHeight - 4 ||
+ boundingRect.left <= 0 || boundingRect.left * zoomFactor >= window.innerWidth - 4)
continue;
if (boundingRect.width < 3 || boundingRect.height < 3)