summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-rul.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/node-rul.lua')
-rw-r--r--tex/context/base/mkiv/node-rul.lua32
1 files changed, 16 insertions, 16 deletions
diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua
index ea0e5c7a0..1df5bf32a 100644
--- a/tex/context/base/mkiv/node-rul.lua
+++ b/tex/context/base/mkiv/node-rul.lua
@@ -48,7 +48,9 @@ local setattrlist = nuts.setattrlist
local setshift = nuts.setshift
local getwidth = nuts.getwidth
local setwidth = nuts.setwidth
+local setoffsets = nuts.setoffsets
local setfield = nuts.setfield
+local getdata = nuts.getdata
local isglyph = nuts.isglyph
@@ -163,28 +165,23 @@ local ruleactions = { }
rules .ruleactions = ruleactions
nutrules.ruleactions = ruleactions -- convenient
-local function mathradical(n,h,v)
- ----- size = getfield(n,"index")
- local font = getfield(n,"transform")
+local function mathaction(n,h,v,what)
+ local font = CONTEXTLMTXMODE > 1 and getdata(n) or getfield(n,"transform")
local actions = fontresources[font].mathruleactions
if actions then
- local action = actions.radicalaction
+ local action = actions[what]
if action then
action(n,h,v,font)
end
end
end
+local function mathradical(n,h,v)
+ mathaction(n,h,v,"radicalaction")
+end
+
local function mathrule(n,h,v)
- ----- size = getfield(n,"index")
- local font = getfield(n,"transform")
- local actions = fontresources[font].mathruleactions
- if actions then
- local action = actions.hruleaction
- if action then
- action(n,h,v,font)
- end
- end
+ mathaction(n,h,v,"hruleaction")
end
local function useraction(n,h,v)
@@ -745,7 +742,7 @@ implement {
actions = nodes.linefillers.enable
}
--- We add a bonus feature here:
+-- We add a bonus feature here (experiment):
interfaces.implement {
name = "autorule",
@@ -754,19 +751,22 @@ interfaces.implement {
{ "width", "dimension" },
{ "height", "dimension" },
{ "depth", "dimension" },
+ { "xoffset", "dimension" },
+ { "yoffset", "dimension" },
{ "left", "dimension" },
{ "right", "dimension" },
},
},
actions = function(t)
- local l = t.left
- local r = t.right
local n = new_rule(
t.width,
t.height,
t.depth
)
setattrlist(n,true)
+ setoffsets(n,t.xoffset,t.yoffset) -- ,t.left, t.right
+ local l = t.left
+ local r = t.right
if l then
setfield(n,"left",l)
end