From 34dc70f0a26a867b37315dbbdd14c3ae02ff2b4d Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Wed, 13 Apr 2016 22:04:10 +0000 Subject: web2c/luatexdir: sync with the upstream git-svn-id: svn://tug.org/texlive/trunk@40490 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/tex/packaging.w | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.w b/Build/source/texk/web2c/luatexdir/tex/packaging.w index 5b9aa8b8995..4a5ab77c690 100644 --- a/Build/source/texk/web2c/luatexdir/tex/packaging.w +++ b/Build/source/texk/web2c/luatexdir/tex/packaging.w @@ -1144,6 +1144,8 @@ scaled_whd natural_sizes(halfword p, halfword pp, glue_ratio g_mult, int hpack_dir; scaled_whd xx; /* for recursion */ scaled_whd whd, siz = { 0, 0, 0 }; + scaled gp = 0; + scaled gm = 0; if (pack_direction == -1) { hpack_dir = text_direction; } else { @@ -1208,10 +1210,16 @@ scaled_whd natural_sizes(halfword p, halfword pp, glue_ratio g_mult, if (g_sign != normal) { if (g_sign == stretching) { if (stretch_order(p) == g_order) { - siz.wd += float_round(float_cast(g_mult) * float_cast(stretch(p))); + /* + siz.wd += float_round(float_cast(g_mult) * float_cast(stretch(p))); + */ + gp += stretch(p); } } else if (shrink_order(p) == g_order) { - siz.wd -= float_round(float_cast(g_mult) * float_cast(shrink(p))); + /* + siz.wd -= float_round(float_cast(g_mult) * float_cast(shrink(p))); + */ + gm += shrink(p); } } if (subtype(p) >= a_leaders) { @@ -1243,6 +1251,13 @@ scaled_whd natural_sizes(halfword p, halfword pp, glue_ratio g_mult, } } + if (g_sign != normal) { + if (g_sign == stretching) { + siz.wd += float_round(float_cast(g_mult) * float_cast(gp)); + } else { + siz.wd -= float_round(float_cast(g_mult) * float_cast(gm)); + } + } return siz; } -- cgit v1.2.3