client/notes: fix placement after mouse scroll
This commit is contained in:
parent
fd2df3966d
commit
d6f27e82c6
1 changed files with 7 additions and 5 deletions
|
@ -17,11 +17,13 @@ class PostNotesOverlayControl {
|
||||||
const polygonRect = e.target.getBBox();
|
const polygonRect = e.target.getBBox();
|
||||||
this._textNode.querySelector('.wrapper').innerHTML
|
this._textNode.querySelector('.wrapper').innerHTML
|
||||||
= misc.formatMarkdown(e.target.getAttribute('data-text'));
|
= misc.formatMarkdown(e.target.getAttribute('data-text'));
|
||||||
this._textNode.style.left = (
|
const x = (
|
||||||
svgRect.left + svgRect.width * polygonRect.x) + 'px';
|
-bodyRect.left + svgRect.left + svgRect.width * polygonRect.x);
|
||||||
this._textNode.style.top = (
|
const y = (
|
||||||
svgRect.top + svgRect.height * (
|
-bodyRect.top + svgRect.top + svgRect.height * (
|
||||||
polygonRect.y + polygonRect.height)) + 'px';
|
polygonRect.y + polygonRect.height));
|
||||||
|
this._textNode.style.left = x + 'px';
|
||||||
|
this._textNode.style.top = y + 'px';
|
||||||
this._textNode.style.display = 'block';
|
this._textNode.style.display = 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue