fix for Angus' redraw problem.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7317 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-07-18 14:04:49 +00:00
parent 359583859f
commit b6eefddb85
3 changed files with 12 additions and 14 deletions

View File

@ -278,21 +278,21 @@ void InsetFormula::metrics(MetricsInfo & m, Dimension & dim) const
{ {
view_ = m.base.bv; view_ = m.base.bv;
if (preview_->previewReady()) { if (preview_->previewReady()) {
dim_.asc = preview_->pimage()->ascent(); dim.asc = preview_->pimage()->ascent();
dim_.des = preview_->pimage()->descent(); dim.des = preview_->pimage()->descent();
// insert a one pixel gap in front of the formula // insert a one pixel gap in front of the formula
dim_.wid = 1 + preview_->pimage()->width(); dim.wid = 1 + preview_->pimage()->width();
if (display()) if (display())
dim_.des += 12; dim.des += 12;
} else { } else {
MetricsInfo mi = m; MetricsInfo mi = m;
mi.base.style = LM_ST_TEXT; mi.base.style = LM_ST_TEXT;
mi.base.font.setColor(LColor::math); mi.base.font.setColor(LColor::math);
par()->metrics(mi, dim_); par()->metrics(mi, dim_);
dim_.asc += 1; dim.asc += 1;
dim_.des += 1; dim.des += 1;
} }
dim = dim_; dim_ = dim;
} }

View File

@ -119,8 +119,6 @@ protected:
mutable int xo_; mutable int xo_;
/// ///
mutable int yo_; mutable int yo_;
///
mutable Dimension dim_;
}; };
// We don't really mess want around with mathed stuff outside mathed. // We don't really mess want around with mathed stuff outside mathed.

View File

@ -178,15 +178,15 @@ void RowPainter::paintInset(pos_type const pos)
Assert(inset); Assert(inset);
MetricsInfo mi(perv(bv_), getFont(pos), text_.workWidth()); //MetricsInfo mi(perv(bv_), getFont(pos), text_.workWidth());
Dimension dim; //Dimension dim;
inset->metrics(mi, dim); //inset->metrics(mi, dim);
PainterInfo pi(perv(bv_)); PainterInfo pi(perv(bv_));
pi.base.font = getFont(pos); pi.base.font = getFont(pos);
#warning metrics? #warning metrics?
inset->draw(pi, int(x_), yo_ + row_->baseline()); inset->draw(pi, int(x_), yo_ + row_->baseline());
x_ += dim.wid; x_ += inset->width();
} }
@ -1014,7 +1014,7 @@ void RowPainter::paint()
text_.prepareToPrint(row_, x_, separator_, hfill_, label_hfill_); text_.prepareToPrint(row_, x_, separator_, hfill_, label_hfill_);
// FIXME: what is this fixing ? // FIXME: what is this fixing ?
if (text_.isInInset() && (x_ < 0)) if (text_.isInInset() && x_ < 0)
x_ = 0; x_ = 0;
x_ += xo_; x_ += xo_;