From cbe7775bc89f98b1b6833802499865a453f2774f Mon Sep 17 00:00:00 2001 From: georgeto <9250103+georgeto@users.noreply.github.com> Date: Sat, 31 Dec 2022 01:01:17 +0100 Subject: [PATCH] CheckMark: Fix on tap toggling of checkmarks in SortWidget (#9941) The x and y coordinates of SortItemWidget's checkmark widgets were not updated, thus remained at their initial value 0. Consequently the intersectWith check in SortItemWidget:onTap always evaluated to false, resulting in taps on checkmarks in the sort widget not being recognized. Co-authored-by: NiLuJe --- frontend/ui/widget/checkmark.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/ui/widget/checkmark.lua b/frontend/ui/widget/checkmark.lua index b2963a3b8..7e50eb4be 100644 --- a/frontend/ui/widget/checkmark.lua +++ b/frontend/ui/widget/checkmark.lua @@ -84,4 +84,13 @@ function CheckMark:init() self.dimen = unchecked_widget:getSize() end +function CheckMark:paintTo(bb, x, y) + -- NOTE: Account for alignment/offsets computation being tacked on to self.dimen... + -- This is dumb and probably means we're doing something wonky... somewhere, but it works, + -- and allows us to keep sensible coordinates in dimen, so that they can be used for hitbox checks. + WidgetContainer.paintTo(self, bb, x - self.dimen.x, y - self.dimen.y) + self.dimen.x = x + self.dimen.y = y +end + return CheckMark