]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_deliminset.C
fix drawing glitch
[lyx.git] / src / mathed / math_deliminset.C
index 435b33f1f0abc074837a3db315c9789d596079af..57ba6a220ff4cdd9accf04f55b4e926dd922006e 100644 (file)
@@ -59,8 +59,8 @@ void MathDelimInset::normalize(NormalStream & os) const
 int MathDelimInset::dw() const
 {
        int w = height() / 5;
-       if (w > 15)
-               w = 15;
+       if (w > 12)
+               w = 12;
        if (w < 4)
                w = 4;
        return w;
@@ -91,9 +91,27 @@ void MathDelimInset::draw(Painter & pain, int x, int y) const
 }
 
 
+bool MathDelimInset::isParanthesis() const
+{
+       return left_ == "(" && right_ == ")";
+}
+
+
+bool MathDelimInset::isBrackets() const
+{
+       return left_ == "[" && right_ == "]";
+}
+
+
+bool MathDelimInset::isAbs() const
+{
+       return left_ == "|" && right_ == "|";
+}
+
+
 void MathDelimInset::maplize(MapleStream & os) const
 {
-       if (left_ == "|" && right_ == "|") {
+       if (isAbs()) {
                bool mat =
                        cell(0).size() == 1 && cell(0).begin()->nucleus()
                                        && cell(0).begin()->nucleus()->asMatrixInset();
@@ -116,7 +134,7 @@ void MathDelimInset::mathmlize(MathMLStream & os) const
 
 void MathDelimInset::octavize(OctaveStream & os) const
 {
-       if (left_ == "|" && right_ == "|")
+       if (isAbs())
                os << "det(" << cell(0) << ")";
        else
                os << left_.c_str() << cell(0) << right_.c_str();