From a036ac2dd19b592316e1b479360e9e6c6700e935 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Mon, 15 Feb 2016 11:15:07 +0100 Subject: 2016-02-15 10:29:00 --- tex/context/base/mkiv/node-res.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tex/context/base/mkiv/node-res.lua') 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) -- cgit v1.2.3