]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathDecoration.cpp
Remove hardcoded values
[lyx.git] / src / mathed / InsetMathDecoration.cpp
index e152efe6b1f757f79ede087c165c0bfe8209e270..f7fd6ea2aa20300162d2e8da059131322b378705 100644 (file)
@@ -105,9 +105,9 @@ InsetMath::mode_type InsetMathDecoration::currentMode() const
 
 void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       bool really_change_font = currentMode() == TEXT_MODE
-                               && isMathFont(mi.base.fontname);
-       Changer dummy = really_change_font ? mi.base.changeFontSet("textnormal")
+       Changer dummy =
+               (currentMode() == MATH_MODE) ? mi.base.changeEnsureMath() :
+               (isMathFont(mi.base.fontname)) ? mi.base.changeFontSet("textnormal")
                : Changer();
 
        cell(0).metrics(mi, dim);
@@ -129,9 +129,9 @@ void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const
 {
-       bool really_change_font = currentMode() == TEXT_MODE
-                                     && isMathFont(pi.base.fontname);
-       Changer dummy = really_change_font ? pi.base.changeFontSet("textnormal")
+       Changer dummy =
+               (currentMode() == MATH_MODE) ? pi.base.changeEnsureMath() :
+               (isMathFont(pi.base.fontname)) ? pi.base.changeFontSet("textnormal")
                : Changer();
 
        cell(0).draw(pi, x + 1, y);
@@ -142,7 +142,6 @@ void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const
                mathed_draw_deco(pi, x + 1 + (dim0.wid - dw_) / 2,
                        y + dy_, dw_, dh_, key_->name);
        drawMarkers(pi, x, y);
-       setPosCache(pi, x, y);
 }