summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/packaging.w19
1 files changed, 17 insertions, 2 deletions
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;
}