From ef628d694a3e6c289b68f16f4ea3bb0c686a0ed8 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 28 Mar 2024 19:58:56 -0300 Subject: client: fix minor dynamic tooltip placement math error This code is meant to replace a rectangle that is the result of an intersection with a spanning-infinitely-left region, i.e. the opportunity area for placing a tooltip to the left of its hoverable, with a narrow channel so that its `x` is the appropriate left alignment for the tooltip. That behavior is working correctly (hopefully), but the fallback is that it *shouldn't* be modifying a rectangle which intersected with a spanning-infinitely-right region. We were mistakenly dropping anything to do with the intersection and returning the region rectangle instead, which broke vertical alignment any time a tooltip is aligned to the right of the hoverable. --- src/static/client3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/static') diff --git a/src/static/client3.js b/src/static/client3.js index 236e98a..485ae3c 100644 --- a/src/static/client3.js +++ b/src/static/client3.js @@ -1666,7 +1666,7 @@ function getTooltipFromHoverablePlacementOpportunityAreas(hoverable) { const regionRect = regionRects[i]; if (regionRect.width > 0) { - return regionRect; + return rect; } else { return WikiRect.fromRect({ x: regionRect.right - tooltipRect.width, -- cgit 1.3.0-6-gf8a5