summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/trac-vis.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-09-24 13:11:46 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-09-24 13:11:46 +0200
commit236690a6367b25187d37013e1e7fc196c5c44eb8 (patch)
treea1c9520899dc817b2cf492750c10a1990331c273 /tex/context/base/mkiv/trac-vis.lua
parent9858ddd23d54c56b2ce9e1f5580190d3210d18ed (diff)
downloadcontext-236690a6367b25187d37013e1e7fc196c5c44eb8.tar.gz
2016-09-24 12:45:00
Diffstat (limited to 'tex/context/base/mkiv/trac-vis.lua')
-rw-r--r--tex/context/base/mkiv/trac-vis.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua
index bffb1807c..ef73d2182 100644
--- a/tex/context/base/mkiv/trac-vis.lua
+++ b/tex/context/base/mkiv/trac-vis.lua
@@ -99,6 +99,7 @@ local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
local traverse_nodes = nuts.traverse
local linked_nodes = nuts.linked
+local apply_to_nodes = nuts.apply
local effectiveglue = nuts.effective_glue
@@ -240,7 +241,7 @@ end
local function setvisual(n,a,what,list) -- this will become more efficient when we have the bit lib linked in
if not n or n == "reset" then
return unsetvalue
- elseif n == "makeup" then
+ elseif n == true or n == "makeup" then
if not a or a == 0 or a == unsetvalue then
a = preset_makeup
else
@@ -288,6 +289,16 @@ function nuts.setvisuals(n,mode)
setattr(n,a_visual,setvisual(mode,getattr(n,a_visual),true,true))
end
+function nuts.applyvisuals(n,mode)
+ local a = unsetvalue
+ if mode == true then
+ a = texgetattribute (a_visual)
+ elseif mode then
+ a = setvisual(mode)
+ end
+ apply_to_nodes(n,function(n) setattr(n,a_visual,a) end)
+end
+
function nuts.copyvisual(n,m)
setattr(n,a_visual,getattr(m,a_visual))
end