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 <ninuje@gmail.com>
reviewable/pr9982/r1
georgeto 1 year ago committed by GitHub
parent 8d133507ad
commit cbe7775bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save