Paged documents: rework zoom options (#6885)

- Move zoom options from top menu to bottom config
- Add option to manually define zoom (relative to
  page width) and overlap (in percent)
- Add options to zoom to columns or rows, possibly
  with overlap. Add panning direction options when
  page forward in these modes
This commit is contained in:
jperon
2020-11-28 17:18:57 +01:00
committed by GitHub
parent 52f66a89d2
commit 8eeb010dc9
37 changed files with 2189 additions and 232 deletions

View File

@@ -339,7 +339,7 @@ function util.arrayAppend(t1, t2)
end
end
-- Reverse array elements in-place in table t
--- Reverse array elements in-place in table t
---- @param t Lua table
function util.arrayReverse(t)
local i, j = 1, #t
@@ -350,6 +350,22 @@ function util.arrayReverse(t)
end
end
--- Test whether t contains a value equal to v
--- (or such a value that callback returns true),
--- and if so, return the index.
---- @param t Lua table
---- @param v
---- @function callback(v1, v2)
function util.arrayContains(t, v, cb)
cb = cb or function(v1, v2) return v1 == v2 end
for _k, _v in ipairs(t) do
if cb(_v, v) then
return _k
end
end
return false
end
-- Merge t2 into t1, overwriting existing elements if they already exist
-- Probably not safe with nested tables (c.f., https://stackoverflow.com/q/1283388)
---- @param t1 Lua table