]> git.gir.st - VimFx.git/commit
Try points one pixel into the elements from the edges
authorSimon Lydell <simon.lydell@gmail.com>
Tue, 30 Sep 2014 19:17:04 +0000 (21:17 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Tue, 30 Sep 2014 19:17:04 +0000 (21:17 +0200)
commit6919c1d6c6ef6a2a70734c13cfaac54b983fd968
treecd789a0209130b248e52e5140072729697adf36e
parentc0cd2182427361609df57b8622f97c0549c4244e
Try points one pixel into the elements from the edges

On newyorker.com, `transform: translate3d(0, 0, 0)` is applied on the
content container, to force hardware acceleration. It seems to move
everything a pixel, causing `document.elementFromPoint` to fail at the
edges of elements. This commit no longer looks exactly at the edges of
elements, but one pixel in, which seems to be a safer strategy. (The
marker is still nicely placed exactly on the edge, though.)

Example page:
http://www.newyorker.com/currency-tag/the-virtual-moleskine
extension/packages/mode-hints/hints.coffee
extension/packages/mode-hints/marker.coffee
Imprint / Impressum