Combine the separation between different layouts (with same depth)

Fix for #12402.
This commit is contained in:
Daniel Ramoeller 2021-10-21 09:29:54 +02:00 committed by Jean-Marc Lasgouttes
parent b365a47112
commit aad18e969a

View File

@ -1202,7 +1202,10 @@ int TextMetrics::parTopSpacing(pit_type const pit) const
&& prevpar.getLabelWidthString() == par.getLabelWidthString()) {
layoutasc = layout.itemsep * dh;
} else if (pit != 0 && layout.topsep > 0)
layoutasc = layout.topsep * dh;
// combine the separation between different layouts (with same depth)
layoutasc = max(0.0,
prevpar.getDepth() != par.getDepth() ? layout.topsep
: layout.topsep - prevpar.layout().bottomsep) * dh;
asc += int(layoutasc * 2 / (2 + pars[pit].getDepth()));