From 4ec7efb2d09f0447ed8aa57bf60e9f653de6bce4 Mon Sep 17 00:00:00 2001 From: poire-z Date: Wed, 30 Nov 2016 16:41:03 +0100 Subject: [PATCH] Fix selection in dictionary window (#2126) Fix #2126 (hold on a word on the 2nd page of a definition was triggering lookup of the word at the same place in 1st page). --- frontend/ui/widget/textboxwidget.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ui/widget/textboxwidget.lua b/frontend/ui/widget/textboxwidget.lua index 43181f407..8058c03d3 100644 --- a/frontend/ui/widget/textboxwidget.lua +++ b/frontend/ui/widget/textboxwidget.lua @@ -292,7 +292,7 @@ function TextBoxWidget:onHoldWord(callback, ges) if not callback then return end local x, y = ges.pos.x - self.dimen.x, ges.pos.y - self.dimen.y - local line_num = math.ceil(y / self.line_height_px) + local line_num = math.ceil(y / self.line_height_px) + self.virtual_line_num-1 local line = self.vertical_string_list[line_num] DEBUG("holding on line", line) if line then