From 7ea34ec4760046e82e4b79aa8169bef69a28e0e9 Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Wed, 24 Jul 2024 00:54:55 -0300 Subject: [PATCH] Fix overflow --- src/tooltip.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tooltip.ts b/src/tooltip.ts index 6313b38..5910ec4 100644 --- a/src/tooltip.ts +++ b/src/tooltip.ts @@ -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