diff options
Diffstat (limited to 'tex/context/base/mkiv/node-res.lua')
-rw-r--r-- | tex/context/base/mkiv/node-res.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua index 91de6171d..5bc414b68 100644 --- a/tex/context/base/mkiv/node-res.lua +++ b/tex/context/base/mkiv/node-res.lua @@ -167,6 +167,7 @@ local noad = register_nut(new_nut("noad")) 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 userrule = register_nut(new_nut("rule",rulecodes.user)) 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") @@ -374,6 +375,23 @@ function nutpool.emptyrule(width,height,depth,dir) -- w/h/d == nil will let them return n end +function nutpool.userrule(width,height,depth,dir) -- w/h/d == nil will let them adapt + local n = copy_nut(userrule) + 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) |