Take the height of label into account when painting rows

Handle the case where, in beamer's Frame, for example, where the label
string uses a taller font then the paragraph itself.

Fixes bug #11890.
This commit is contained in:
Jean-Marc Lasgouttes 2020-07-14 20:51:05 +02:00
parent b299bd9730
commit bce21e8975

View File

@ -1145,6 +1145,14 @@ void TextMetrics::setRowHeight(Row & row) const
int maxasc = int(fm.maxAscent() * spacing_val);
int maxdes = int(fm.maxDescent() * spacing_val);
// Take label string into account (useful if labelfont is large)
if (row.pos() == 0 && layout.labelIsInline()) {
FontInfo const labelfont = text_->labelFont(par);
FontMetrics const & lfm = theFontMetrics(labelfont);
maxasc = max(maxasc, int(lfm.maxAscent() * spacing_val));
maxdes = max(maxdes, int(lfm.maxDescent() * spacing_val));
}
// Find the ascent/descent of the row contents
for (Row::Element const & e : row) {
if (e.inset) {