Skip to content

Commit

Permalink
Fix overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanM04 authored and marijnh committed Jul 24, 2024
1 parent 2cb2602 commit 7ea34ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,11 @@ const tooltipPlugin = ViewPlugin.fromClass(class {
let arrowHeight = arrow ? Arrow.Size : 0
let width = size.right - size.left, height = knownHeight.get(tView) ?? size.bottom - size.top
let offset = tView.offset || noOffset, ltr = this.view.textDirection == Direction.LTR
let left = size.width > space.right - space.left ? (ltr ? space.left : space.right - size.width)
: ltr ? Math.min(pos.left - (arrow ? Arrow.Offset : 0) + offset.x, space.right - width)
: Math.max(space.left, pos.left - width + (arrow ? Arrow.Offset : 0) - offset.x)
let left = size.width > space.right - space.left
? (ltr ? space.left : space.right - size.width)
: ltr
? Math.max(space.left, Math.min(pos.left - (arrow ? Arrow.Offset : 0) + offset.x, space.right - width))
: Math.min(Math.max(space.left, pos.left - width + (arrow ? Arrow.Offset : 0) - offset.x), space.right - width)
let above = this.above[i]
if (!tooltip.strictSide && (above
? pos.top - (size.bottom - size.top) - offset.y < space.top
Expand Down

0 comments on commit 7ea34ec

Please sign in to comment.