From: Daniel Carl Date: Sat, 12 Oct 2013 11:15:32 +0000 (+0200) Subject: Changed hinting visibility check. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=71539b1dd4443d511e37c7002c145eda3f62dbfe;p=vimb.git 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. --- 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,