Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into hint_page_fix

Conflicts:
	frontend/document/document.lua
pull/2/merge
Qingping Hou 12 years ago
commit c8dce5f351

@ -204,7 +204,10 @@ end
-- a hint for the cache engine to paint a full page to the cache
-- TODO: this should trigger a background operation
function Document:hintPage(pageno, zoom, rotation, render_mode)
self:renderPage(pageno, nil, zoom, rotation, render_mode)
local hash_full_page = "renderpg|"..self.file.."|"..pageno.."|"..zoom.."|"..rotation.."|"..render_mode
if not Cache:check(hash_full_page) then
self:renderPage(pageno, nil, zoom, rotation, render_mode)
end
end
--[[
@ -216,8 +219,8 @@ Draw page content to blitbuffer.
@rect: visible_area inside document page
--]]
function Document:drawPage(target, x, y, rect, pageno, zoom, rotation, render_mode)
local hash_full_page = "renderpg|"..self.file.."|"..pageno.."|"..zoom.."|"..rotation
local hash_excerpt = "renderpg|"..self.file.."|"..pageno.."|"..zoom.."|"..rotation.."|"..tostring(rect)
local hash_full_page = "renderpg|"..self.file.."|"..pageno.."|"..zoom.."|"..rotation.."|"..render_mode
local hash_excerpt = hash_full_page.."|"..tostring(rect)
local tile = Cache:check(hash_full_page)
if not tile then
tile = Cache:check(hash_excerpt)

@ -77,6 +77,7 @@ end
function ReaderPaging:onCloseDocument()
self.ui.doc_settings:saveSetting("last_page", self.current_page)
self.ui.doc_settings:saveSetting("percent_finished", self.current_page/self.number_of_pages)
end
function ReaderPaging:onTapForward()

@ -103,8 +103,9 @@ end
function ReaderRolling:onCloseDocument()
local cur_xp = self.ui.document:getXPointer()
self.ui.doc_settings:saveSetting("last_percent",
10000 * self.ui.document:getPosFromXPointer(cur_xp) / self.doc_height)
local cur_pos = self.ui.document:getPosFromXPointer(cur_xp)
self.ui.doc_settings:saveSetting("last_percent", 10000 * cur_pos / self.doc_height)
self.ui.doc_settings:saveSetting("percent_finished", cur_pos / self.doc_height)
end
function ReaderRolling:onTapForward()
@ -133,7 +134,7 @@ end
function ReaderRolling:onGotoViewRel(diff)
DEBUG("goto relative screen:", diff)
if self.ui.document.view_mode ~= "page" then
if self.view_mode ~= "page" then
local pan_diff = diff * self.ui.dimen.h
if self.show_overlap_enable then
if pan_diff > self.overlap then
@ -186,7 +187,7 @@ function ReaderRolling:gotoPos(new_pos)
if new_pos < 0 then new_pos = 0 end
if new_pos > self.doc_height then new_pos = self.doc_height end
-- adjust dim_area according to new_pos
if self.ui.document.view_mode ~= "page" and self.show_overlap_enable then
if self.view_mode ~= "page" and self.show_overlap_enable then
local panned_step = new_pos - self.current_pos
self.view.dim_area.x = 0
self.view.dim_area.h = self.ui.dimen.h - math.abs(panned_step)

Loading…
Cancel
Save