From d8a58e87644e13327af00be2525df71a8fdd52b2 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 11 Mar 2012 23:55:42 +0100 Subject: [PATCH] revert 70b7e029d383e33df8fb4c3a00547d4069e7dd53 It's not that simple since ZOOM_FIT_TO_CONTENT_HALF_WIDTH also needs bounding boxes, and this seems like over-optimization which seems to be bug infested especially because it deals with negative numbers so code just *looks* wrong --- unireader.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/unireader.lua b/unireader.lua index 987eee400..c96a4f14a 100644 --- a/unireader.lua +++ b/unireader.lua @@ -209,17 +209,13 @@ function UniReader:setzoom(page) local dc = self.newDC() local pwidth, pheight = page:getSize(self.nulldc) print("# page::getSize "..pwidth.."*"..pheight); - local x0, y0, x1, y1 = 0, 0, pwidth, pheight - - -- only get usedBBox in fit to content mode - if self.globalzoommode <= self.ZOOM_FIT_TO_CONTENT and - self.globalzoommode >= self.ZOOM_FIT_TO_CONTENT_HALF_WIDTH_MARGIN then - x0, y0, x1, y1 = page:getUsedBBox() - if x0 == 0.01 and y0 == 0.01 and x1 == -0.01 and y1 == -0.01 then - x0, y0, x1, y1 = 0, 0, pwidth, pheight - end + local x0, y0, x1, y1 = page:getUsedBBox() + if x0 == 0.01 and y0 == 0.01 and x1 == -0.01 and y1 == -0.01 then + x0 = 0 + y0 = 0 + x1 = pwidth + y1 = pheight end - -- clamp to page BBox if x0 < 0 then x0 = 0 end if x1 > pwidth then x1 = pwidth end