summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/tabl-xtb.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2020-02-16 10:59:14 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2020-02-16 10:59:14 +0100
commit8e11d447440b44990432ac838953a8cde4ef914f (patch)
treef30b2ff2d8a10f1aff50e1522d968618a97f067c /tex/context/base/mkiv/tabl-xtb.lua
parent43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca (diff)
downloadcontext-8e11d447440b44990432ac838953a8cde4ef914f.tar.gz
2020-02-11 16:39:00
Diffstat (limited to 'tex/context/base/mkiv/tabl-xtb.lua')
-rw-r--r--tex/context/base/mkiv/tabl-xtb.lua32
1 files changed, 23 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/tabl-xtb.lua b/tex/context/base/mkiv/tabl-xtb.lua
index d2b1e9768..2ff87e21a 100644
--- a/tex/context/base/mkiv/tabl-xtb.lua
+++ b/tex/context/base/mkiv/tabl-xtb.lua
@@ -478,36 +478,50 @@ end
function xtables.initialize_construct()
local r = data.currentrow
local c = data.currentcolumn + 1
+ local settings = data.settings
local rows = data.rows
local row = rows[r]
while row[c].span do -- can also be previous row ones
c = c + 1
end
data.currentcolumn = c
- local widths = data.widths
- local heights = data.heights
- local depths = data.depths
+ local widths = data.widths
+ local heights = data.heights
+ local depths = data.depths
+ local distances = data.distances
--
local drc = row[c]
local wd = drc.wd
local ht = drc.ht
local dp = drc.dp
+ local nx = drc.nx - 1
+ local ny = drc.ny - 1
--
local width = widths[c]
local height = heights[r]
local depth = depths[r] -- problem: can be the depth of a one liner
--
- for x=1,drc.nx-1 do
- width = width + widths[c+x]
+ local total = height + depth
+ --
+ if nx > 0 then
+ for x=1,nx do
+ width = width + widths[c+x] + distances[c+x-1]
+ end
+ local distance = settings.columndistance
+ if distance ~= 0 then
+ width = width + nx * distance
+ end
end
--
- local total = height + depth
- local ny = drc.ny
- if ny > 1 then
- for y=1,ny-1 do
+ if ny > 0 then
+ for y=1,ny do
local nxt = r + y
total = total + heights[nxt] + depths[nxt]
end
+ local distance = settings.rowdistance
+ if distance ~= 0 then
+ total = total + ny * distance
+ end
end
--
texsetdimen("d_tabl_x_width",width)