From 0828468b121f28ab5d135c503fcbb0309efa4f0b Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 24 Sep 2012 16:35:48 +0200 Subject: [PATCH] try to draw inverted rectangles over links This commit nicely shows that we need to translate link coordinates --- unireader.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/unireader.lua b/unireader.lua index a9a73f22a..cc7d189ee 100644 --- a/unireader.lua +++ b/unireader.lua @@ -2860,11 +2860,19 @@ function UniReader:addAllCommands() end end ) - self.commands:add(KEY_L, MOD_SHIFT, "L", + self.commands:add(KEY_L, nil, "L", "page links", function(unireader) - Debug("unireader", unireader) - unireader:getPageLinks( unireader.pageno ) + local links = unireader:getPageLinks( unireader.pageno ) + if next(links) == nil then + showInfoMsgWithDelay("No links on this page", 2000, 1) + else + for i, link in ipairs(links) do + Debug("link", i, link) + fb.bb:invertRect(link.x0, link.y0, link.x1 - link.x0, link.y1 - link.y0) + fb:refresh(1, link.x0, link.y0, link.x1 - link.x0, link.y1 - link.y0) + end + end end ) self.commands:add(KEY_BACK,MOD_ALT,"Back",