diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-02-08 16:15:08 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-02-08 16:15:08 +0100 |
commit | d73f5987ca04dbdf0a134236c3314dadd7a73565 (patch) | |
tree | 8471e66baf2a1ca638f9339fe360ca1da7b0bcc5 /tex/context/base/mkiv/node-res.lua | |
parent | 47878599fddea4d4e259e3371def1afadc62e03b (diff) | |
download | context-d73f5987ca04dbdf0a134236c3314dadd7a73565.tar.gz |
2016-02-08 15:37:00
Diffstat (limited to 'tex/context/base/mkiv/node-res.lua')
-rw-r--r-- | tex/context/base/mkiv/node-res.lua | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua index 7aac2a166..91de6171d 100644 --- a/tex/context/base/mkiv/node-res.lua +++ b/tex/context/base/mkiv/node-res.lua @@ -24,6 +24,7 @@ local nodepool = nodes.pool local whatsitcodes = nodes.whatsitcodes local skipcodes = nodes.skipcodes local kerncodes = nodes.kerncodes +local rulecodes = nodes.rulecodes local nodecodes = nodes.nodecodes local glyph_code = nodecodes.glyph @@ -164,9 +165,10 @@ local noad = register_nut(new_nut("noad")) -- the dir field needs to be set otherwise crash: -local rule = register_nut(new_nut("rule")) setfield(rule, "dir","TLT") -local hlist = register_nut(new_nut("hlist")) setfield(hlist,"dir","TLT") -local vlist = register_nut(new_nut("vlist")) setfield(vlist,"dir","TLT") +local rule = register_nut(new_nut("rule")) setfield(rule, "dir","TLT") +local emptyrule = register_nut(new_nut("rule",rulecodes.empty)) setfield(rule, "dir","TLT") +local hlist = register_nut(new_nut("hlist")) setfield(hlist,"dir","TLT") +local vlist = register_nut(new_nut("vlist")) setfield(vlist,"dir","TLT") function nutpool.zeroglue(n) if n then @@ -355,6 +357,23 @@ function nutpool.rule(width,height,depth,dir) -- w/h/d == nil will let them adap return n end +function nutpool.emptyrule(width,height,depth,dir) -- w/h/d == nil will let them adapt + local n = copy_nut(emptyrule) + if width then -- also 0 else adapt + setfield(n,"width",width) + end + if height then -- also 0 else adapt + setfield(n,"height",height) + end + if depth then -- also 0 else adapt + setfield(n,"depth",depth) + end + if dir then + setfield(n,"dir",dir) + end + return n +end + function nutpool.latelua(code) local n = copy_nut(latelua) setfield(n,"string",code) |