]> git.lyx.org Git - lyx.git/commitdiff
* Changing the font does not change the fontmetrics variable,
authorStefan Schimanski <sts@lyx.org>
Sun, 10 Jun 2007 14:54:45 +0000 (14:54 +0000)
committerStefan Schimanski <sts@lyx.org>
Sun, 10 Jun 2007 14:54:45 +0000 (14:54 +0000)
  hence we have to set it manually.
  (bug #3787: Huge fonts do not set the row height)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18731 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextMetrics.cpp

index 405c6ca88a234f90d4ffdcd74279a8a912cdd163..d3d7bae61c6563338e86a1079468792885ebe246 100644 (file)
@@ -663,9 +663,11 @@ void TextMetrics::setHeightOfRow(pit_type const pit,
        Font::FONT_SIZE maxsize =
                par.highestFontInRange(row.pos(), pos_end, size);
        if (maxsize > font.size()) {
+               // use standard paragraph font with the maximal size
                font.setSize(maxsize);
-               maxasc  = max(maxasc,  fontmetrics.maxAscent());
-               maxdesc = max(maxdesc, fontmetrics.maxDescent());
+               FontMetrics const & maxfontmetrics = theFontMetrics(font);
+               maxasc  = max(maxasc,  maxfontmetrics.maxAscent());
+               maxdesc = max(maxdesc, maxfontmetrics.maxDescent());
        }
 
        // This is nicer with box insets: