diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-01-27 16:14:16 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-01-27 16:14:16 +0100 |
commit | 95a1799032dc61dbca4a11e495be34b4397c8fec (patch) | |
tree | 4b24bf117a90ba704dedf19ab1b1a734d78f4e45 /tex/context/base/mkiv/typo-mar.lua | |
parent | 0cfeab235554eeee0dddd6c3f44d3939ab490ff1 (diff) | |
download | context-95a1799032dc61dbca4a11e495be34b4397c8fec.tar.gz |
2017-01-27 14:46:00
Diffstat (limited to 'tex/context/base/mkiv/typo-mar.lua')
-rw-r--r-- | tex/context/base/mkiv/typo-mar.lua | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tex/context/base/mkiv/typo-mar.lua b/tex/context/base/mkiv/typo-mar.lua index dbf6602e7..680fb20cc 100644 --- a/tex/context/base/mkiv/typo-mar.lua +++ b/tex/context/base/mkiv/typo-mar.lua @@ -75,6 +75,7 @@ local getattr = nuts.getattr local setattr = nuts.setattr local getsubtype = nuts.getsubtype local getlist = nuts.getlist +local getwhd = nuts.getwhd local setlist = nuts.setlist local setlink = nuts.setlink @@ -94,6 +95,8 @@ local vlist_code = nodecodes.vlist local whatsit_code = nodecodes.whatsit local userdefined_code = whatsitcodes.userdefined +local n_flush_node = nodes.flush + local nodepool = nuts.pool local new_usernumber = nodepool.usernumber @@ -268,16 +271,17 @@ function margins.save(t) local leftmargindistance = texgetdimen("naturalleftmargindistance") local rightmargindistance = texgetdimen("naturalrightmargindistance") local strutbox = getbox("strutbox") + local _, strutht, strutdp = getwhd(strutbox) -- better make a new table and make t entry in t t.box = content t.n = nofsaved -- used later (we will clean up this natural mess later) -- nice is to make a special status table mechanism - t.strutdepth = getfield(strutbox,"depth") - t.strutheight = getfield(strutbox,"height") - -- beware: can be different from the applied one - t.leftskip = getfield(texget("leftskip"),"width") -- we're not in forgetall - t.rightskip = getfield(texget("rightskip"),"width") -- we're not in forgetall + t.strutheight = strutht + t.strutdepth = strutdp + -- beware: can be different from the applied one (we're not in forgetall) + t.leftskip = texget("leftskip",false) + t.rightskip = texget("rightskip",false) -- t.leftmargindistance = leftmargindistance -- todo:layoutstatus table t.rightmargindistance = rightmargindistance @@ -497,9 +501,8 @@ local function inject(parent,head,candidate) if not box then return head, nil, false -- we can have empty texts end - local width = getfield(box,"width") - local height = getfield(box,"height") - local depth = getfield(box,"depth") + local width, height, depth + = getwhd(box) local shift = getfield(box,"shift") local stack = candidate.stack local stackname = candidate.stackname @@ -622,8 +625,9 @@ local function inject(parent,head,candidate) shift = shift + voffset + delta end elseif method == v_line then - if getfield(parent,"depth") == 0 then - local delta = height - getfield(parent,"height") + local _, ph, pd = getwhd(parent) + if pd == 0 then + local delta = height - ph if trace_margindata then report_margindata("top aligned by %p (no depth)",delta) end |