]> git.lyx.org Git - features.git/commitdiff
fix 'purple box has wrong size in x_{}'
authorAndré Pönitz <poenitz@gmx.net>
Tue, 11 Sep 2001 14:15:30 +0000 (14:15 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 11 Sep 2001 14:15:30 +0000 (14:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2726 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_atom.C
src/mathed/math_scriptinset.C
src/mathed/xarray.C

index 217f10906956974a9413f6a8c17fafe5fe9d322e..cedad2b5c54ac8ca64eefa4a1d46ec1a0acc7783 100644 (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);
 }
 
 
index 019c045e37ed8a7129bf452deedce02c237961f8..9e8732797e8f11824554d5ff0a1281198b5b0d76 100644 (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";
 }
 
 
index 4aa396bfa8debfa15333ff9cb299c257734eb52d..1a31caee9f13e93a55b62b91357318fa19939675 100644 (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";
 }