]> git.lyx.org Git - features.git/commitdiff
some pixel "corrections"
authorAndré Pönitz <poenitz@gmx.net>
Mon, 3 Sep 2001 11:38:04 +0000 (11:38 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 3 Sep 2001 11:38:04 +0000 (11:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2663 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formulabase.C
src/mathed/math_matrixinset.C
src/mathed/xarray.C

index 48e92c0d2826ccdbd0126e622fd45ba7e7e2197e..70b06ae8353a63bf42012441dbd45ff0fc99b733 100644 (file)
@@ -216,6 +216,7 @@ void InsetFormulaBase::getCursorPos(BufferView *, int & x, int & y) const
        mathcursor->getPos(x, y);
        x -= par()->xo();
        y -= par()->yo();
+       y -= 3;
 }
 
 
@@ -232,10 +233,11 @@ void InsetFormulaBase::toggleInsetCursor(BufferView * bv)
                mathcursor->getPos(x, y);
                //x -= par()->xo();
                y -= par()->yo();
+               y -= 3;
                int asc;
-               int desc;
-               math_font_max_dim(LM_TC_TEXTRM, LM_ST_TEXT, asc, desc);
-               bv->showLockedInsetCursor(x, y, asc, desc);
+               int des;
+               math_font_max_dim(LM_TC_TEXTRM, LM_ST_TEXT, asc, des);
+               bv->showLockedInsetCursor(x, y, asc, des);
        }
 
        toggleCursorVisible();
@@ -252,9 +254,9 @@ void InsetFormulaBase::showInsetCursor(BufferView * bv, bool)
                        x -= par()->xo();
                        y -= par()->yo();
                        int asc;
-                       int desc;
-                       math_font_max_dim(LM_TC_TEXTRM, LM_ST_TEXT, asc, desc);
-                       bv->fitLockedInsetCursor(x, y, asc, desc);
+                       int des;
+                       math_font_max_dim(LM_TC_TEXTRM, LM_ST_TEXT, asc, des);
+                       bv->fitLockedInsetCursor(x, y, asc, des);
                }
                toggleInsetCursor(bv);
        }
index d0f082e8f3da908780b3c7505ec0ea773f098b0e..f03b92feb5efe867698e6d52b0232b5bd3ad76ad 100644 (file)
@@ -114,6 +114,13 @@ void MathMatrixInset::metrics(MathStyles) const
                if (l)
                        width_ += 30 + l;
        }
+
+       // make it at least as high as the current font
+       int asc = 0;
+       int des = 0;
+       math_font_max_dim(LM_TC_TEXTRM, LM_ST_TEXT, asc, des);
+       ascent_  = std::max(ascent_,  asc);
+       descent_ = std::max(descent_, des);
 }
 
 
index 5fff5bb75ad091cc258cbcb144fcd235b06cc902..9f90ef41ef890fb9ef60255ce1adee32e1bddd62 100644 (file)
@@ -27,7 +27,8 @@ void MathXArray::metrics(MathStyles st) const
 
        if (data_.empty()) 
                return;
-       
+
+       math_font_max_dim(LM_TC_TEXTRM, LM_ST_TEXT, ascent_, descent_); 
        width_   = 0;
 
        //lyxerr << "MathXArray::metrics(): '" << data_ << "'\n";