X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathDiagram.cpp;h=c2019d4be856930273f5d456822a6ca327bfec07;hb=02e82157ec583c3900e359de86be79fac6512387;hp=5c8887c76f80a981d0c22aa09c7ab90e8c398aa7;hpb=460a764b7f601871dbb8ed4ad0f8260e7cdad509;p=lyx.git diff --git a/src/mathed/InsetMathDiagram.cpp b/src/mathed/InsetMathDiagram.cpp index 5c8887c76f..c2019d4be8 100644 --- a/src/mathed/InsetMathDiagram.cpp +++ b/src/mathed/InsetMathDiagram.cpp @@ -13,9 +13,11 @@ #include "InsetMathDiagram.h" -#include "LaTeXFeatures.h" #include "MathStream.h" +#include "LaTeXFeatures.h" +#include "MetricsInfo.h" + #include namespace lyx { @@ -46,12 +48,24 @@ int InsetMathDiagram::rowsep() const void InsetMathDiagram::metrics(MetricsInfo & mi, Dimension & dim) const { - if (mi.base.style == LM_ST_DISPLAY) - mi.base.style = LM_ST_TEXT; + Changer dummy2 = mi.base.changeEnsureMath(); + FontInfo & f = mi.base.font; + Changer dummy = (f.style() == LM_ST_DISPLAY) ? f.changeStyle(LM_ST_TEXT) + : Changer(); InsetMathGrid::metrics(mi, dim); } +void InsetMathDiagram::draw(PainterInfo & pi, int x, int y) const +{ + Changer dummy2 = pi.base.changeEnsureMath(); + FontInfo & f = pi.base.font; + Changer dummy = (f.style() == LM_ST_DISPLAY) ? f.changeStyle(LM_ST_TEXT) + : Changer(); + InsetMathGrid::draw(pi, x, y); +} + + void InsetMathDiagram::write(WriteStream & os) const { MathEnsurer ensurer(os);