fix page to screen rect transform for highlighting

This commit is contained in:
chrox
2014-05-11 20:19:00 +08:00
parent 7a4d0e47f1
commit 8f982faa7b
2 changed files with 3 additions and 2 deletions

View File

@@ -61,10 +61,12 @@ function ReaderLink:onTap(arg, ges)
if self.ui.document.info.has_pages then
local pos = self.view:screenToPageTransform(ges.pos)
if pos then
-- link box in native page
local link, lbox = self.ui.document:getLinkFromPosition(pos.page, pos)
if link and lbox then
-- screen box that holds the link
local sbox = self.view:pageToScreenTransform(pos.page, lbox)
local sbox = self.view:pageToScreenTransform(pos.page,
self.ui.document:nativeToPageRectTransform(pos.page, lbox))
if sbox then
UIManager:show(LinkBox:new{
box = sbox,