From 71539b1dd4443d511e37c7002c145eda3f62dbfe Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sat, 12 Oct 2013 13:15:32 +0200 Subject: [PATCH] Changed hinting visibility check. Don't even check if the point in the center of the element is the element itself, because this caused broken links to be not hintable, if the second link line didn't reach the center of the above line. So now the element is checked for the upper left corner too. --- src/hints.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/hints.js b/src/hints.js index d183dfd..7017667 100644 --- a/src/hints.js +++ b/src/hints.js @@ -46,14 +46,12 @@ var VbHint = (function(){ if (cStyle.display === "none" || cStyle.visibility !== "visible") { return false; } - /* check if the element at the center of current is that element self */ - /* else the element is covers by another element or within a hidden container */ - if (!e.childElementCount - && e.ownerDocument.elementFromPoint((rect.left + rect.right)/2, (rect.top + rect.bottom)/2) !== e - ) { - return false; - } - return true; + + /* check if the element at the left top or center of current is the element self */ + /* else the element is covered by another element or within a hidden container */ + return e.childElementCount > 0 + || e.ownerDocument.elementFromPoint((rect.left + rect.right)/2, (rect.top + rect.bottom)/2) === e + || e.ownerDocument.elementFromPoint(rect.left, rect.top + rect.bottom) === e } var doc = win.document, -- 2.20.1