fix vertical pointer position

This commit is contained in:
Sandeep Somavarapu 2021-07-15 21:20:21 +02:00
parent 7dda760ac5
commit fc1f3a4337
No known key found for this signature in database
GPG key ID: 1FED25EC4646638B

View file

@ -375,9 +375,9 @@ export class HoverWidget extends Widget {
this._hoverPointer.classList.add(this._hoverPosition === HoverPosition.LEFT ? 'right' : 'left');
const hoverHeight = this._hover.containerDomNode.clientHeight;
// If hover is taller than target and aligned with target's bottom, then show the pointer at the center of target
if (hoverHeight > target.height && this._y === target.bottom) {
this._hoverPointer.style.top = `${target.center.y - target.top - Constants.PointerSize}px`;
// If hover is taller than target, then show the pointer at the center of target
if (hoverHeight > target.height) {
this._hoverPointer.style.top = `${target.center.y - (this._y - hoverHeight) - Constants.PointerSize}px`;
}
// Otherwise show the pointer at the center of hover