fix 'purple box has wrong size in x_{}'

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2726 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-09-11 14:15:30 +00:00
parent a4eb2c3040
commit cd093e5884
3 changed files with 10 additions and 10 deletions

View File

@ -206,7 +206,8 @@ MathScriptInset * MathAtom::down() const
int MathAtom::dy0() const
{
lyx::Assert(down());
if (!down())
return ndes();
int des = down()->ascent();
if (hasLimits())
des += ndes() + 2;
@ -218,7 +219,8 @@ int MathAtom::dy0() const
int MathAtom::dy1() const
{
lyx::Assert(up());
if (!up())
return nasc();
int asc = up()->descent();
if (hasLimits())
asc += nasc() + 2;
@ -252,19 +254,13 @@ int MathAtom::dxx() const
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);
}

View File

@ -33,6 +33,8 @@ void MathScriptInset::metrics(MathStyles st) const
width_ = xcell(0).width();
ascent_ = xcell(0).ascent();
descent_ = xcell(0).descent();
//lyxerr << "MathScriptInset::metrics: w: " << width_ << " a: " << ascent_
// << " d: " << descent_ << "\n";
}

View File

@ -36,6 +36,8 @@ void MathXArray::metrics(MathStyles st) const
descent_ = std::max(descent_, p->descent());
width_ += p->width();
}
//lyxerr << "MathXArray::metrics(): '" << ascent_ << " "
// << descent_ << " " << width_ << "'\n";
}