X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathDiagram.cpp;h=66d577f6b02ddf3734b3e286aae6a28a86daca2d;hb=4ed0312c51704780af1c452d3a82a84171b3725a;hp=d5a1b5231aea43b94550bb92db894ac352ef25f6;hpb=348e0241af2dd8e5e1dda30e28d89c3a7f1fc03b;p=lyx.git diff --git a/src/mathed/InsetMathDiagram.cpp b/src/mathed/InsetMathDiagram.cpp index d5a1b5231a..66d577f6b0 100644 --- a/src/mathed/InsetMathDiagram.cpp +++ b/src/mathed/InsetMathDiagram.cpp @@ -48,13 +48,25 @@ 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() == DISPLAY_STYLE) ? f.changeStyle(TEXT_STYLE) + : noChange(); InsetMathGrid::metrics(mi, dim); } -void InsetMathDiagram::write(WriteStream & os) const +void InsetMathDiagram::draw(PainterInfo & pi, int x, int y) const +{ + Changer dummy2 = pi.base.changeEnsureMath(); + FontInfo & f = pi.base.font; + Changer dummy = (f.style() == DISPLAY_STYLE) ? f.changeStyle(TEXT_STYLE) + : noChange(); + InsetMathGrid::draw(pi, x, y); +} + + +void InsetMathDiagram::write(TeXMathStream & os) const { MathEnsurer ensurer(os); os << "\\Diagram";