From: André Pönitz Date: Tue, 11 Sep 2001 14:15:30 +0000 (+0000) Subject: fix 'purple box has wrong size in x_{}' X-Git-Tag: 1.6.10~20627 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cd093e58848d0eece9efb3c19f9220a5ae6961d1;p=features.git 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 --- diff --git a/src/mathed/math_atom.C b/src/mathed/math_atom.C index 217f109069..cedad2b5c5 100644 --- a/src/mathed/math_atom.C +++ b/src/mathed/math_atom.C @@ -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); } diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index 019c045e37..9e8732797e 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -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"; } diff --git a/src/mathed/xarray.C b/src/mathed/xarray.C index 4aa396bfa8..1a31caee9f 100644 --- a/src/mathed/xarray.C +++ b/src/mathed/xarray.C @@ -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"; }