- int m = x + width() / 2;
- int yo = y - cell(1).ascent() - cell(0).descent() - 1;
- cell(1).draw(pi, m - cell(1).width() / 2, y);
- FracChanger dummy(pi.base);
- cell(0).draw(pi, m - cell(0).width() / 2, yo);
- drawMarkers(pi, x, y);
+ Changer dummy2 = pi.base.changeEnsureMath();
+ Dimension const dim = dimension(*pi.base.bv);
+ Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
+ Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
+ int m = x + dim.wid / 2;
+ int yo = y - dim0.asc - dim1.des - 1;
+ cell(0).draw(pi, m - dim0.wid / 2, y);
+ Changer dummy = pi.base.changeScript();
+ cell(1).draw(pi, m - dim1.width() / 2, yo);
+}
+
+
+bool InsetMathOverset::idxUpDown(Cursor & cur, bool up) const
+{
+ idx_type target = up; // up ? 1 : 0, since upper cell has idx 1
+ if (cur.idx() == target)
+ return false;
+ cur.idx() = target;
+ cur.pos() = cur.cell().x2pos(&cur.bv(), cur.x_target());
+ return true;