]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathAMSArray.cpp
Assure correct spacing of colored items in mathed
[lyx.git] / src / mathed / InsetMathAMSArray.cpp
index 24a1fef7de5943fbb7303346b6c0a1a5cfb066a3..61608041867202287dab071026bf6940d70b7dbe 100644 (file)
@@ -83,21 +83,43 @@ char const * InsetMathAMSArray::name_right() const
 }
 
 
+int InsetMathAMSArray::rowsep() const
+{
+       return small() ? 0 : InsetMathGrid::rowsep();
+}
+
+
+int InsetMathAMSArray::colsep() const
+{
+       return small() ? InsetMathGrid::colsep() / 2 : InsetMathGrid::colsep();
+}
+
+
+int InsetMathAMSArray::border() const
+{
+       return small() ? 0 : InsetMathGrid::border();
+}
+
+
 void InsetMathAMSArray::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       Changer dummy = mi.base.changeArray();
+       Changer dummy2 = mi.base.changeEnsureMath();
+       Changer dummy = mi.base.changeArray(small());
        InsetMathGrid::metrics(mi, dim);
 }
 
 
 void InsetMathAMSArray::draw(PainterInfo & pi, int x, int y) const
 {
-       Dimension const dim = dimension(*pi.base.bv);
-       int const yy = y - dim.ascent();
-       // Drawing the deco after changeStyle does not work
-       mathed_draw_deco(pi, x + 1, yy, 5, dim.height(), from_ascii(name_left()));
-       mathed_draw_deco(pi, x + dim.width() - 8, yy, 5, dim.height(), from_ascii(name_right()));
-       Changer dummy = pi.base.changeArray();
+       Changer dummy2 = pi.base.changeEnsureMath();
+       if (name_ != "smallmatrix") {
+               Dimension const dim = dimension(*pi.base.bv);
+               int const yy = y - dim.ascent();
+               // Drawing the deco after changeStyle does not work
+               mathed_draw_deco(pi, x + 1, yy, 5, dim.height(), from_ascii(name_left()));
+               mathed_draw_deco(pi, x + dim.width() - 8, yy, 5, dim.height(), from_ascii(name_right()));
+       }
+       Changer dummy = pi.base.changeArray(small());
        InsetMathGrid::draw(pi, x, y);
 }