diff options
Diffstat (limited to 'tex/context/base/pack-rul.lua')
-rw-r--r-- | tex/context/base/pack-rul.lua | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua index 909c0c168..a990936e7 100644 --- a/tex/context/base/pack-rul.lua +++ b/tex/context/base/pack-rul.lua @@ -10,21 +10,16 @@ if not modules then modules = { } end modules ['pack-rul'] = { <p>An explanation is given in the history document <t>mk</t>.</p> --ldx]]-- -local hpack = node.hpack -local free = node.free -local copy = node.copy_list -local traverse_id = node.traverse_id -local node_dimensions = node.dimensions +local texsetdimen, texsetcount, texbox = tex.setdimen, tex.setcount, tex.box +local hpack, free, copy, traverse_id = node.hpack, node.free, node.copy_list, node.traverse_id +local texdimen, texcount = tex.dimen, tex.count local hlist_code = nodes.nodecodes.hlist local box_code = nodes.listcodes.box - -local texsetdimen = tex.setdimen -local texsetcount = tex.setcount -local texgetbox = tex.getbox +local node_dimensions = node.dimensions function commands.doreshapeframedbox(n) - local box = texgetbox(n) + local box = texbox[n] local noflines = 0 local firstheight = nil local lastdepth = nil @@ -81,16 +76,17 @@ function commands.doreshapeframedbox(n) end end end - texsetcount("global","framednoflines",noflines) - texsetdimen("global","framedfirstheight",firstheight or 0) - texsetdimen("global","framedlastdepth",lastdepth or 0) - texsetdimen("global","framedminwidth",minwidth) - texsetdimen("global","framedmaxwidth",maxwidth) - texsetdimen("global","framedaveragewidth",noflines > 0 and totalwidth/noflines or 0) + -- print("reshape", noflines, firstheight or 0, lastdepth or 0) + texsetcount("global","framednoflines", noflines) + texsetdimen("global","framedfirstheight", firstheight or 0) + texsetdimen("global","framedlastdepth", lastdepth or 0) + texsetdimen("global","framedminwidth", minwidth) + texsetdimen("global","framedmaxwidth", maxwidth) + texsetdimen("global","framedaveragewidth", noflines > 0 and totalwidth/noflines or 0) end function commands.doanalyzeframedbox(n) - local box = texgetbox(n) + local box = texbox[n] local noflines = 0 local firstheight = nil local lastdepth = nil @@ -106,7 +102,8 @@ function commands.doanalyzeframedbox(n) end end end - texsetcount("global","framednoflines",noflines) - texsetdimen("global","framedfirstheight",firstheight or 0) - texsetdimen("global","framedlastdepth",lastdepth or 0) + -- print("analyze", noflines, firstheight or 0, lastdepth or 0) + texsetcount("global","framednoflines", noflines) + texsetdimen("global","framedfirstheight", firstheight or 0) + texsetdimen("global","framedlastdepth", lastdepth or 0) end |