local q
head, q = node_remove(head, p)
if char_data.round_threshold then
- local frac = abs(pwidth / fwidth);
- local quot = floor(frac)
- if frac-quot <char_data.round_threshold then fwidth = fwidth * quot end
+ local frac = pwidth / fwidth
+ local quot = floor(frac+0.5)
+ if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end
end
local xo, yo = getoffsets(p)
setoffsets(p, xo + char_data.align*(fwidth-pwidth) - fshift.left,
end
fwidth = fwidth or pwidth
if fwidth~=pwidth and char_data.round_threshold then
- local frac = abs(pwidth / fwidth);
- local quot = floor(frac)
- if frac-quot <char_data.round_threshold then fwidth = fwidth * quot end
+ local frac = pwidth / fwidth
+ local quot = floor(frac+0.5)
+ if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end
end
fshift.down = char_data.down; fshift.left = char_data.left
fshift = call_callback("luatexja.set_width", fshift, met, char_data)