negative x panning if writing direction is set right to left

so that in right to left writing/drawing system the right part
of the page is drawn first
This commit is contained in:
chrox
2014-08-06 22:06:34 +08:00
parent 0be62439df
commit d7fa72e46c
3 changed files with 12 additions and 5 deletions

View File

@@ -459,11 +459,17 @@ function ReaderView:recalculate()
self.state.page,
self.state.zoom,
self.state.rotation)
-- starts from left top of page_area
self.visible_area.x = self.page_area.x
self.visible_area.y = self.page_area.y
-- reset our size
self.visible_area:setSizeTo(self.dimen)
if self.ui.document.configurable.writing_direction == 0 then
-- starts from left top of page_area
self.visible_area.x = self.page_area.x
self.visible_area.y = self.page_area.y
else
-- start from right top of page_area
self.visible_area.x = self.page_area.x + self.page_area.w - self.visible_area.w
self.visible_area.y = self.page_area.y
end
-- and recalculate it according to page size
self.visible_area:offsetWithin(self.page_area, 0, 0)
-- clear dim area