mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #144 from dpavlin/master
few more InfoMessages in crereader
This commit is contained in:
@@ -317,9 +317,12 @@ function CREReader:adjustCreReaderCommands()
|
||||
"increase/decrease font size",
|
||||
function(self)
|
||||
local delta = 1
|
||||
local change = "increase"
|
||||
if keydef.keycode == KEY_PGBCK or keydef.keycode == KEY_LPGBCK then
|
||||
delta = -1
|
||||
change = "decrease"
|
||||
end
|
||||
InfoMessage:show(change.." font size", 0)
|
||||
self.doc:zoomFont(delta)
|
||||
self:redrawCurrentPage()
|
||||
end
|
||||
@@ -373,12 +376,12 @@ function CREReader:adjustCreReaderCommands()
|
||||
|
||||
local item_no = fonts_menu:choose(0, G_height)
|
||||
debug(face_list[item_no])
|
||||
Screen:restoreFromSavedBB()
|
||||
if item_no then
|
||||
self.doc:setFontFace(face_list[item_no])
|
||||
self.font_face = face_list[item_no]
|
||||
InfoMessage:show("Redrawing with "..face_list[item_no], 0)
|
||||
end
|
||||
Screen:restoreFromSavedBB()
|
||||
self:redrawCurrentPage()
|
||||
end
|
||||
)
|
||||
|
||||
@@ -54,7 +54,7 @@ UniReader = {
|
||||
pan_by_page = false, -- using shift_[xy] or width/height
|
||||
pan_x = 0, -- top-left offset of page when pan activated
|
||||
pan_y = 0,
|
||||
pan_margin = 20, -- horizontal margin for two-column zoom
|
||||
pan_margin = 5, -- horizontal margin for two-column zoom (in pixels)
|
||||
pan_overlap_vertical = 30,
|
||||
show_overlap = 0,
|
||||
|
||||
@@ -1260,13 +1260,11 @@ function UniReader:setzoom(page, preCache)
|
||||
or self.globalzoom_mode == self.ZOOM_FIT_TO_CONTENT_HALF_WIDTH_MARGIN then
|
||||
local margin = self.pan_margin
|
||||
if self.globalzoom_mode == self.ZOOM_FIT_TO_CONTENT_HALF_WIDTH then margin = 0 end
|
||||
local pg_margin = 0 -- margin scaled to page size
|
||||
if margin > 0 then pg_margin = margin * 2 / self.globalzoom end
|
||||
self.globalzoom = width / (x1 - x0 + pg_margin)
|
||||
self.globalzoom = width / (x1 - x0 + margin)
|
||||
self.offset_x = -1 * x0 * self.globalzoom * 2 + margin
|
||||
self.globalzoom = height / (y1 - y0 + pg_margin)
|
||||
self.globalzoom = height / (y1 - y0 + margin)
|
||||
self.offset_y = -1 * y0 * self.globalzoom * 2 + margin
|
||||
self.globalzoom = width / (x1 - x0 + pg_margin) * 2
|
||||
self.globalzoom = width / (x1 - x0 + margin) * 2
|
||||
debug("column mode offset:", self.offset_x, self.offset_y, " zoom:", self.globalzoom);
|
||||
self.globalzoom_mode = self.ZOOM_BY_VALUE -- enable pan mode
|
||||
self.pan_x = self.offset_x
|
||||
|
||||
Reference in New Issue
Block a user