cre scroll mode: fix last line of book hidden by footer

By scrolling last page a little bit further.

Also fix a few other scroll mode issues, all related
to doc_height not being updated (eg, in the middle of
a book, and doubling the font size, one would not
be able to turn pages and read the 2nd half of the
book...)
This commit is contained in:
poire-z
2019-02-26 07:19:55 +01:00
committed by Frans de Jonge
parent 918f296bd3
commit 1c0a8c1ef9
2 changed files with 23 additions and 8 deletions

View File

@@ -200,10 +200,19 @@ function CreDocument:render()
end
logger.dbg("CreDocument: rendering document...")
self._document:renderDocument()
if not self.info.has_pages then
self.info.doc_height = self._document:getFullHeight()
self.been_rendered = true
logger.dbg("CreDocument: rendering done.")
end
function CreDocument:_readMetadata()
Document._readMetadata(self) -- will grab/update self.info.number_of_pages
if self.been_rendered then
-- getFullHeight() would crash if the document is not
-- yet rendered
self.info.doc_height = self._document:getFullHeight()
end
logger.dbg("CreDocument: rendering done.")
return true
end
function CreDocument:close()