X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathDecoration.cpp;h=f7fd6ea2aa20300162d2e8da059131322b378705;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=acc49743fa3455843166ee86e3d78a0e5b36cc55;hpb=f643ae700700cbd9aa0b1aca8155c6d7f2aee34d;p=lyx.git diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index acc49743fa..f7fd6ea2aa 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -105,9 +105,10 @@ 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 = mi.base.changeFontSet("textnormal", really_change_font); + Changer dummy = + (currentMode() == MATH_MODE) ? mi.base.changeEnsureMath() : + (isMathFont(mi.base.fontname)) ? mi.base.changeFontSet("textnormal") + : Changer(); cell(0).metrics(mi, dim); @@ -128,9 +129,10 @@ 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 = pi.base.changeFontSet("textnormal", really_change_font); + Changer dummy = + (currentMode() == MATH_MODE) ? pi.base.changeEnsureMath() : + (isMathFont(pi.base.fontname)) ? pi.base.changeFontSet("textnormal") + : Changer(); cell(0).draw(pi, x + 1, y); Dimension const & dim0 = cell(0).dimension(*pi.base.bv); @@ -140,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); }