add math.lua, move all math related helpers in to it

This commit is contained in:
Qingping Hou
2013-02-19 11:57:14 +08:00
parent 79b3ee91c7
commit f3452234ea
5 changed files with 33 additions and 36 deletions

View File

@@ -1,3 +1,5 @@
require "../math"
--[[
This is a registry for document providers
]]--
@@ -126,17 +128,9 @@ function Document:getPageDimensions(pageno, zoom, rotation)
return native_dimen
end
function Document:oddEven(number)
if number % 2 == 1 then
return "odd"
else
return "even"
end
end
function Document:getPageBBox(pageno)
local bbox = self.bbox[pageno] -- exact
local oddEven = self:oddEven(pageno)
local oddEven = math.oddEven(pageno)
if bbox ~= nil then
DEBUG("bbox from", pageno)
else