]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
Streamlining CollapseStatus stuff
[lyx.git] / src / TextMetrics.cpp
index 405c6ca88a234f90d4ffdcd74279a8a912cdd163..fec9111b685c531501e57f1be89df110a5f21c20 100644 (file)
@@ -339,8 +339,11 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit,
                        case Inset::AlignCenter:
                                align = LYX_ALIGN_CENTER;
                                break;
-                       // other types unchanged (use align)
-                       }
+                        case Inset::Inline:
+                        case Inset::AlignRight:
+                                // unchanged (use align)
+                                break;
+                    }
                }
 
                switch (align) {
@@ -663,9 +666,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: