mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix footnotes and markers with full status bar
Take full/top status bar's height into account when computing coordinates. Also wrap getPageMargins() in CreDocument, so we don't use cre.cpp _document directly anywhere else.
This commit is contained in:
@@ -476,9 +476,10 @@ function ReaderRolling:onGotoXPointer(xp, marker_xp)
|
||||
local doc_y = self.ui.document:getPosFromXPointer(marker_xp)
|
||||
local top_y = self.ui.document:getCurrentPos()
|
||||
local screen_y = doc_y - top_y
|
||||
local doc_margins = self.ui.document._document:getPageMargins()
|
||||
local doc_margins = self.ui.document:getPageMargins()
|
||||
local header_height = self.ui.document:getHeaderHeight() -- top full status bar (0 when bottom mini bar used)
|
||||
if self.view.view_mode == "page" then
|
||||
screen_y = screen_y + doc_margins["top"]
|
||||
screen_y = screen_y + doc_margins["top"] + header_height
|
||||
end
|
||||
local marker_h = Screen:scaleBySize(self.ui.font.font_size * 1.1 * self.ui.font.line_space_percent/100.0)
|
||||
-- Make it 4/5 of left margin wide (and bigger when huge margin)
|
||||
|
||||
Reference in New Issue
Block a user