From: Yutao Yuan Date: Mon, 28 Mar 2016 11:11:19 +0000 (+0800) Subject: Use the beginning position of links for hinting X-Git-Url: https://git.owens.tech/assets/me.jpg/assets/me.jpg/git?a=commitdiff_plain;h=822c2b5b658a6d6beb39c53a24f7893f0bc0336a;p=vimb.git Use the beginning position of links for hinting --- diff --git a/src/hints.js b/src/hints.js index 458d85c..ee3ddf3 100644 --- a/src/hints.js +++ b/src/hints.js @@ -90,8 +90,8 @@ Object.freeze((function(){ } var rect = e.getBoundingClientRect(); if (!rect || - rect.top > offsets.bottom || rect.bottom < offsets.top || - rect.left > offsets.right || rect.right < offsets.left + rect.top >= offsets.bottom || rect.bottom <= offsets.top || + rect.left >= offsets.right || rect.right <= offsets.left ) { return false; } @@ -137,7 +137,7 @@ Object.freeze((function(){ count++; /* create the hint label with number */ - rect = e.getBoundingClientRect(); + rect = e.getClientRects()[0]; label = labelTmpl.cloneNode(false); label.setAttribute( "style", [