mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user