int MathAtom::dy0() const
{
- lyx::Assert(down());
+ if (!down())
+ return ndes();
int des = down()->ascent();
if (hasLimits())
des += ndes() + 2;
int MathAtom::dy1() const
{
- lyx::Assert(up());
+ if (!up())
+ return nasc();
int asc = up()->descent();
if (hasLimits())
asc += nasc() + 2;
int MathAtom::ascent() const
{
- int asc = nasc();
- if (up())
- asc += hasLimits() ? up()->height() + 2 : up()->ascent();
- return asc;
+ return dy1() + (up() ? up()->ascent() : 0);
}
int MathAtom::descent() const
{
- int des = ndes();
- if (down())
- des += hasLimits() ? down()->height() + 2 : down()->descent();
- return des;
+ return dy0() + (down() ? down()->descent() : 0);
}
width_ = xcell(0).width();
ascent_ = xcell(0).ascent();
descent_ = xcell(0).descent();
+ //lyxerr << "MathScriptInset::metrics: w: " << width_ << " a: " << ascent_
+ // << " d: " << descent_ << "\n";
}
descent_ = std::max(descent_, p->descent());
width_ += p->width();
}
+ //lyxerr << "MathXArray::metrics(): '" << ascent_ << " "
+ // << descent_ << " " << width_ << "'\n";
}