local node_new = Dnode.new
local node_remove = luatexja.Dnode_remove -- Dnode.remove
local node_tail = Dnode.tail
-local node_next = Dnode.getnext
+local node_next = (Dnode ~= node) and Dnode.getnext or node.next
local has_attr = Dnode.has_attribute
local set_attr = Dnode.set_attribute
local node_insert_before = Dnode.insert_before
local q
head, q = node_remove(head, p)
setfield(p, 'yoffset', -fshift.down); setfield(p, 'next', nil)
- setfield(p, 'xoffset', getfield(p, 'xoffset') + char_data.align*(fwidth-pwidth))
+ setfield(p, 'xoffset', getfield(p, 'xoffset') + char_data.align*(fwidth-pwidth) - fshift.left)
local box = node_new(id_hlist)
setfield(box, 'width', fwidth)
setfield(box, 'height', fheight)
local y_shift, ca
= - getfield(p, 'yoffset') + (has_attr(p,attr_ykblshift) or 0), char_data.align
setfield(p, 'yoffset', -fshift.down)
- if ca~='left' then
- setfield(p, 'xoffset', getfield(p, 'xoffset') - fshift.left
- + (((ca=='right') and fwidth - pwidth) or round((fwidth - pwidth)*0.5)))
- else
- setfield(p, 'xoffset', getfield(p, 'xoffset') - fshift.left)
- end
+ setfield(p, 'xoffset', getfield(p, 'xoffset') + char_data.align*(fwidth-pwidth) - fshift.left)
local box = node_new(id_hlist);
setfield(box, 'width', fwidth)
setfield(box, 'height', fheight)