diff options
| author | Stephen Blott | 2017-09-12 11:18:27 +0100 |
|---|---|---|
| committer | GitHub | 2017-09-12 11:18:27 +0100 |
| commit | 6a5377125a00af51c943649093d4ba7d5f3404c3 (patch) | |
| tree | fa6b3e5ce50accece4afb696fa59bb3f4441be96 /lib/dom_utils.coffee | |
| parent | 62b36b3bcce6ab1f5b8735ecf1335e40600c5617 (diff) | |
| parent | f9ea449901bc10c81d564e28af64756c7d6f9c9f (diff) | |
| download | vimium-6a5377125a00af51c943649093d4ba7d5f3404c3.tar.bz2 | |
Merge pull request #2636 from mrmr1993/linkhints-scaled-display-fix
Consider devicePixelRatio when calculating viewport
Diffstat (limited to 'lib/dom_utils.coffee')
| -rw-r--r-- | lib/dom_utils.coffee | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index d0bd4615..24747837 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -293,7 +293,8 @@ DomUtils = style = getComputedStyle box if style.position == "static" and not /content|paint|strict/.test(style.contain or "") zoom = +style.zoom || 1 - top: Math.ceil(window.scrollY / zoom), left: Math.ceil(window.scrollX / zoom) + ratio = window.devicePixelRatio ? 1 + top: Math.ceil(window.scrollY * ratio / zoom), left: Math.ceil(window.scrollX * ratio / zoom) else rect = box.getBoundingClientRect() top: -rect.top - box.clientTop, left: -rect.left - box.clientLeft |
