always make sure we switch to page mode in manual cropping

pull/2/merge
Qingping Hou 11 years ago
parent 5b5f6856d3
commit 0d1179a914

@ -5,14 +5,17 @@ ReaderCropping = InputContainer:new{}
function ReaderCropping:onPageCrop(mode)
if mode == "auto" then return end
local orig_reflow_mode = self.document.configurable.text_wrap
self.document.configurable.text_wrap = 0
self.ui:handleEvent(Event:new("CloseConfig"))
self.cropping_zoommode = true
self.cropping_offset = true
-- we are already in page mode, tell ReaderView to recalculate stuff
-- for non-reflow mode
self.view:recalculate()
self.cropping_zoommode = false
if self.document.configurable.text_wrap == 1 then
self.document.configurable.text_wrap = 0
-- if we are in reflow mode, then we are already in page
-- mode, just force readerview to recalculate visible_area
self.view:recalculate()
else
self.ui:handleEvent(Event:new("SetZoomMode", "page"))
end
local ubbox = self.document:getPageBBox(self.current_page)
--DEBUG("used page bbox", ubbox)
self.crop_bbox = BBoxWidget:new{

Loading…
Cancel
Save