]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
* Only enter inset which return true on isActive(). This is the behavior in the curso...
[lyx.git] / src / TextMetrics.cpp
index 405c6ca88a234f90d4ffdcd74279a8a912cdd163..8467e45a189b2618719daf65d83ff134e2de1258 100644 (file)
@@ -663,9 +663,12 @@ void TextMetrics::setHeightOfRow(pit_type const pit,
        Font::FONT_SIZE maxsize =
                par.highestFontInRange(row.pos(), pos_end, size);
        if (maxsize > font.size()) {
-               font.setSize(maxsize);
-               maxasc  = max(maxasc,  fontmetrics.maxAscent());
-               maxdesc = max(maxdesc, fontmetrics.maxDescent());
+               // use standard paragraph font with the maximal size
+               Font maxfont = font;
+               maxfont.setSize(maxsize);
+               FontMetrics const & maxfontmetrics = theFontMetrics(maxfont);
+               maxasc  = max(maxasc,  maxfontmetrics.maxAscent());
+               maxdesc = max(maxdesc, maxfontmetrics.maxDescent());
        }
 
        // This is nicer with box insets: