\savepos
This commit is contained in:
parent
c4b6884897
commit
343da17f30
@ -904,3 +904,19 @@ end, "protected")
|
||||
token.luacmd("lastsavedboxresourceindex", function()
|
||||
return integer_code, lastbox
|
||||
end, "protected", "value")
|
||||
|
||||
local saved_pos_x, saved_pos_y = -1, -1
|
||||
local save_pos_whatsit = declare_whatsit('save_pos', function(_, _, _, x, y)
|
||||
saved_pos_x, saved_pos_y = assert(math.tointeger(x)), assert(math.tointeger(y))
|
||||
end)
|
||||
token.luacmd("savepos", function() -- \savepos
|
||||
return node.direct.write(node.direct.new(whatsit_id, save_pos_whatsit))
|
||||
end, "protected")
|
||||
|
||||
token.luacmd("lastxpos", function()
|
||||
return integer_code, (saved_pos_x+.5)//1
|
||||
end, "protected", "value")
|
||||
|
||||
token.luacmd("lastypos", function()
|
||||
return integer_code, (saved_pos_y+.5)//1
|
||||
end, "protected", "value")
|
||||
|
@ -114,10 +114,7 @@ token.luacmd("immediate", function() -- \immediate
|
||||
local function_id = next_tok.index
|
||||
return functions[function_id](function_id, 'immediate')
|
||||
end, "protected")
|
||||
-- functions[43] = function() -- \pdfvariable
|
||||
-- local name = token.scan_string()
|
||||
-- print('Missing \\pdf' .. name)
|
||||
-- end
|
||||
|
||||
require'luametalatex-baseregisters'
|
||||
require'luametalatex-back-pdf'
|
||||
require'luametalatex-node-luaotfload'
|
||||
|
@ -252,7 +252,7 @@ function nodehandler.vlist(p, list, x, y0, outerlist, origin, level)
|
||||
_, h, d = direct.getwhd(n)
|
||||
end
|
||||
y = y - (h or 0)
|
||||
nodehandler[getid(n)](p, n, x, y, list, y0, level+1)
|
||||
nodehandler[getid(n)](p, n, x, (y+.5)//1, list, y0, level+1)
|
||||
y = y - (d or 0)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user