X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathDecoration.cpp;h=f7fd6ea2aa20300162d2e8da059131322b378705;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=e152efe6b1f757f79ede087c165c0bfe8209e270;hpb=e449e70e3854da3aeda8dca1de22cabaf6ae0557;p=lyx.git diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index e152efe6b1..f7fd6ea2aa 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -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); }