From c84131951f7703e758f7c2bfd562b0ce9719cb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 20 Nov 2001 15:20:03 +0000 Subject: [PATCH] fix 'math background wrong in selected text' problem git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3051 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formula.C | 24 +++++------------------- src/mathed/math_spaceinset.C | 2 +- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 337924f15f..e1127d46a1 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -345,26 +345,12 @@ void InsetFormula::draw(BufferView * bv, LyXFont const & font, int h = par_->height(); int a = par_->ascent(); - bool done = false; -/* - if (LyXText * t = bv->getLyXText()) { - LyXText::Selection & sel = t->selection; - lyxerr << "sel.start: " << sel.start << "\n"; - lyxerr << "sel.end: " << sel.end << "\n"; - lyxerr << "t->cursor: " << t->cursor << "\n"; - if (sel.set() && sel.start < t->cursor && t->cursor < sel.end) { - pain.fillRectangle(x, y - a, w, h, LColor::selection); - done = true; - } - } -*/ - - if (!done) { + if (lcolor.getX11Name(LColor::mathbg)!=lcolor.getX11Name(LColor::background)) pain.fillRectangle(x, y - a, w, h, LColor::mathbg); - if (mathcursor && mathcursor->formula() == this) { - mathcursor->drawSelection(pain); - pain.rectangle(x, y - a, w, h, LColor::mathframe); - } + + if (mathcursor && mathcursor->formula() == this) { + mathcursor->drawSelection(pain); + pain.rectangle(x, y - a, w, h, LColor::mathframe); } par_->draw(pain, x, y); diff --git a/src/mathed/math_spaceinset.C b/src/mathed/math_spaceinset.C index e13b10daf3..d348218c2b 100644 --- a/src/mathed/math_spaceinset.C +++ b/src/mathed/math_spaceinset.C @@ -21,7 +21,7 @@ MathInset * MathSpaceInset::clone() const } -void MathSpaceInset::metrics(MathMetricsInfo const & mi) const +void MathSpaceInset::metrics(MathMetricsInfo const &) const { width_ = space_ ? space_ * 2 : 2; if (space_ > 3)