]> git.lyx.org Git - lyx.git/commitdiff
Amend ad7e2435cfd
authorGuillaume Munch <gm@lyx.org>
Sun, 20 Nov 2016 22:10:12 +0000 (23:10 +0100)
committerGuillaume Munch <gm@lyx.org>
Sun, 20 Nov 2016 23:08:11 +0000 (00:08 +0100)
InsetMathKern is also used for non-mu lengths.

Generalise the fix by moving to Length::inPixels (thanks Jaan-Marc).

src/Length.cpp
src/mathed/InsetMathKern.cpp

index a55d2ef8becf6a56b80e54be503db652188ed57d..5e5a805c67abf1df16452f398b9c470f044fbb44 100644 (file)
@@ -300,7 +300,10 @@ double Length::inInch(double text_width, double em_width) const
 
 int Length::inPixels(MetricsBase const & base) const
 {
-       return inPixels(base.textwidth, theFontMetrics(base.font).em());
+       FontInfo fi = base.font;
+       if (unit_ == Length::MU)
+               fi.setFamily(SYMBOL_FAMILY);
+       return inPixels(base.textwidth, theFontMetrics(fi).em());
 }
 
 
index eb445c382bae8b23d3f7ccad4d36f95fec14f27a..71723b99561f2369340dfee1f35b38c208d944e3 100644 (file)
@@ -49,11 +49,7 @@ void InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        dim.asc = 0;
        dim.des = 0;
-       // match em value used in mathed_*muskip
-       FontInfo const oldfont = mi.base.font;
-       mi.base.font.setFamily(SYMBOL_FAMILY);
        dim.wid = wid_.inPixels(mi.base);
-       mi.base.font = oldfont;
 }