]> git.lyx.org Git - features.git/blobdiff - src/mathed/xarray.C
*** empty log message ***
[features.git] / src / mathed / xarray.C
index f90008e817a4e025744caac7e0e7c9fe3f5900cc..2faafbed91926e30e881f093c22a8ef7f6e761f4 100644 (file)
@@ -59,12 +59,14 @@ void MathXArray::draw(Painter & pain, int x, int y) const
 }
 
 
-int MathXArray::pos2x(size_type targetpos) const
+int MathXArray::pos2x(size_type targetpos, bool inner) const
 {
        int x = 0;
        targetpos = std::min(targetpos, data_.size());
        for (size_type pos = 0; pos < targetpos; ++pos) 
-               x += width(pos);
+               x += width(pos);        
+       if (inner)
+               x += innerwidth(targetpos);
        return x;
 }
 
@@ -91,6 +93,13 @@ int MathXArray::width(size_type pos) const
 }
 
 
+int MathXArray::innerwidth(size_type pos) const
+{
+       MathAtom const * t = data_.at(pos);
+       return t ? t->nwid() : 0;
+}
+
+
 std::ostream & operator<<(std::ostream & os, MathXArray const & ar)
 {
        os << ar.data_;