« get me outta code hell

client: fix minor dynamic tooltip placement math error - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-28 19:58:56 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-03-28 19:58:56 -0300
commitef628d694a3e6c289b68f16f4ea3bb0c686a0ed8 (patch)
tree7c3a4305ea58e38b19f1555175989d1ed4be5e45 /src
parent6fbce92e80e619c5f953d865db729f68b538cff4 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/static/client3.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/static/client3.js b/src/static/client3.js
index 236e98a1..485ae3c3 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,