+bool InsetMathStackrel::idxLast(Cursor & cur) const
+{
+ LASSERT(&cur.inset() == this, return false);
+ cur.idx() = 0;
+ cur.pos() = cur.lastpos();
+ return true;
+}
+
+
+MathClass InsetMathStackrel::mathClass() const
+{
+ // FIXME: update this when/if \stackbin is supported
+ return MC_REL;
+}
+
+
+void InsetMathStackrel::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+ Changer dummy2 = mi.base.changeEnsureMath();
+ Dimension dim0;
+ cell(0).metrics(mi, dim0);
+ Changer dummy = mi.base.changeScript();
+ Dimension dim1;
+ cell(1).metrics(mi, dim1);
+ if (nargs() > 2) {
+ Dimension dim2;
+ cell(2).metrics(mi, dim2);
+ dim.wid = max(max(dim1.width(), dim0.width()), dim2.width()) + 4;
+ dim.asc = dim0.ascent() + dim1.height() + 4;
+ dim.des = dim0.descent() + dim2.height() + dim2.descent() + 1;
+ } else {
+ dim.wid = max(dim1.width(), dim0.width()) + 4;
+ dim.asc = dim0.ascent() + dim1.height() + 4;
+ dim.des = dim0.descent();
+ }
+}
+
+