try to draw inverted rectangles over links

This commit nicely shows that we need to translate link coordinates
This commit is contained in:
Dobrica Pavlinusic
2012-09-24 16:35:48 +02:00
parent 46afa82b52
commit 0828468b12

View File

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