Fixed incorrect border check for tooltips
This commit is contained in:
@ -238,6 +238,8 @@ export default class AnimeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assignTooltipOffsets(elements?: IterableIterator<HTMLElement>) {
|
assignTooltipOffsets(elements?: IterableIterator<HTMLElement>) {
|
||||||
|
const distanceToBorder = 5
|
||||||
|
|
||||||
if(!elements) {
|
if(!elements) {
|
||||||
elements = findAll("tip")
|
elements = findAll("tip")
|
||||||
}
|
}
|
||||||
@ -259,10 +261,10 @@ export default class AnimeNotifier {
|
|||||||
let tipEndX = tipStartX + tipWidth
|
let tipEndX = tipStartX + tipWidth
|
||||||
let leftOffset = 0
|
let leftOffset = 0
|
||||||
|
|
||||||
if(tipStartX < 0) {
|
if(tipStartX < distanceToBorder) {
|
||||||
leftOffset = -tipStartX + 5
|
leftOffset = -tipStartX + distanceToBorder
|
||||||
} else if(tipEndX > contentRect.width) {
|
} else if(tipEndX > contentRect.width - distanceToBorder) {
|
||||||
leftOffset = -(tipEndX - contentRect.width + 5)
|
leftOffset = -(tipEndX - contentRect.width + distanceToBorder)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(leftOffset !== 0) {
|
if(leftOffset !== 0) {
|
||||||
|
Reference in New Issue
Block a user