fix: measure/drawing tooltip was misplaced

Since 70f87d8636

fix #2539
This commit is contained in:
Yohan Boniface 2025-03-04 11:51:13 +01:00
parent c0f7e9d50d
commit 3297296d59

View file

@ -4,6 +4,8 @@ export class Positioned {
this.anchorTop(anchor)
} else if (anchor && position === 'bottom') {
this.anchorBottom(anchor)
} else {
this.anchorAbsolute()
}
}
@ -31,6 +33,15 @@ export class Positioned {
})
}
anchorAbsolute() {
const left =
this.parent.offsetLeft +
this.parent.clientWidth / 2 -
this.container.clientWidth / 2
const top = this.parent.offsetTop + 75
this.setPosition({ top: top, left: left })
}
getPosition(el) {
return el.getBoundingClientRect()
}