]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_rootinset.C
Fix reading of math macros
[lyx.git] / src / mathed / math_rootinset.C
index 1e0a14f027b8126ad5b99eee81681d4fa82961c9..8c442d3bf7045bccd5e37f5bfbd708d748bfaa10 100644 (file)
@@ -37,20 +37,20 @@ MathInset * MathRootInset::clone() const
 void MathRootInset::metrics(MathMetricsInfo & mi) const
 {
        MathNestInset::metrics(mi);
-       dim_.a = max(xcell(0).ascent()  + 5, xcell(1).ascent())  + 2;
-       dim_.d = max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
-       dim_.w = xcell(0).width() + xcell(1).width() + 10;
+       dim_.a = max(cell(0).ascent()  + 5, cell(1).ascent())  + 2;
+       dim_.d = max(cell(1).descent() + 5, cell(0).descent()) + 2;
+       dim_.w = cell(0).width() + cell(1).width() + 10;
        metricsMarkers();
 }
 
 
 void MathRootInset::draw(MathPainterInfo & pi, int x, int y) const
 {
-       int const w = xcell(0).width();
+       int const w = cell(0).width();
        // the "exponent"
-       xcell(0).draw(pi, x, y - 5 - xcell(0).descent());
+       cell(0).draw(pi, x, y - 5 - cell(0).descent());
        // the "base"
-       xcell(1).draw(pi, x + w + 8, y);
+       cell(1).draw(pi, x + w + 8, y);
        int const a = ascent();
        int const d = descent();
        int xp[5];
@@ -59,7 +59,8 @@ void MathRootInset::draw(MathPainterInfo & pi, int x, int y) const
        xp[1] = x + w + 4;    yp[1] = y - a + 1;
        xp[2] = x + w;        yp[2] = y + d;
        xp[3] = x + w - 2;    yp[3] = y + (d - a)/2 + 2;
-       xp[4] = x;            yp[4] = y + (d - a)/2 + 2;
+       //xp[4] = x;            yp[4] = y + (d - a)/2 + 2;
+       xp[4] = x + w - 5;    yp[4] = y + (d - a)/2 + 4;
        pi.pain.lines(xp, yp, 5, LColor::math);
        drawMarkers(pi, x, y);
 }
@@ -88,9 +89,15 @@ bool MathRootInset::idxUpDown(idx_type & idx, pos_type & pos, bool up, int) cons
 }
 
 
+void MathRootInset::maplize(MapleStream & os) const
+{
+       os << '(' << cell(1) << ")^(1/(" << cell(0) <<"))";
+}
+
+
 void MathRootInset::octavize(OctaveStream & os) const
 {
-       os << "root(" << cell(1) << ',' << cell(0) <<')';
+       os << "root(" << cell(1) << ',' << cell(0) << ')';
 }