From 1187eed3a48b85942030489f611e9affcb19cd70 Mon Sep 17 00:00:00 2001 From: Seth VanHeulen <533741+svanheulen@users.noreply.github.com> Date: Fri, 2 Aug 2024 22:09:59 -0400 Subject: [PATCH] Update texts.lua Fixes texts.hover when text is right justified --- addons/libs/texts.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/libs/texts.lua b/addons/libs/texts.lua index 32cf2e9d7..7a3611396 100644 --- a/addons/libs/texts.lua +++ b/addons/libs/texts.lua @@ -589,6 +589,10 @@ function texts.hover(t, x, y) local pos_x, pos_y = windower.text.get_location(meta[t].name) local off_x, off_y = windower.text.get_extents(meta[t].name) + + if meta[t].settings.flags.right then + pos_x = pos_x - off_x + end return (pos_x <= x and x <= pos_x + off_x or pos_x >= x and x >= pos_x + off_x)