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
This commit is contained in:
André Pönitz 2001-11-20 15:20:03 +00:00
parent 26685ea29b
commit c84131951f
2 changed files with 6 additions and 20 deletions

View File

@ -345,26 +345,12 @@ void InsetFormula::draw(BufferView * bv, LyXFont const & font,
int h = par_->height(); int h = par_->height();
int a = par_->ascent(); int a = par_->ascent();
bool done = false; if (lcolor.getX11Name(LColor::mathbg)!=lcolor.getX11Name(LColor::background))
/*
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) {
pain.fillRectangle(x, y - a, w, h, LColor::mathbg); pain.fillRectangle(x, y - a, w, h, LColor::mathbg);
if (mathcursor && mathcursor->formula() == this) {
mathcursor->drawSelection(pain); if (mathcursor && mathcursor->formula() == this) {
pain.rectangle(x, y - a, w, h, LColor::mathframe); mathcursor->drawSelection(pain);
} pain.rectangle(x, y - a, w, h, LColor::mathframe);
} }
par_->draw(pain, x, y); par_->draw(pain, x, y);

View File

@ -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; width_ = space_ ? space_ * 2 : 2;
if (space_ > 3) if (space_ > 3)