From 0db77361d95dbc789b47db8e04928d553d8025c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 3 Sep 2001 11:38:04 +0000 Subject: [PATCH] some pixel "corrections" git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2663 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 14 ++++++++------ src/mathed/math_matrixinset.C | 7 +++++++ src/mathed/xarray.C | 3 ++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 48e92c0d28..70b06ae835 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -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); } diff --git a/src/mathed/math_matrixinset.C b/src/mathed/math_matrixinset.C index d0f082e8f3..f03b92feb5 100644 --- a/src/mathed/math_matrixinset.C +++ b/src/mathed/math_matrixinset.C @@ -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); } diff --git a/src/mathed/xarray.C b/src/mathed/xarray.C index 5fff5bb75a..9f90ef41ef 100644 --- a/src/mathed/xarray.C +++ b/src/mathed/xarray.C @@ -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"; -- 2.39.2