From b6eefddb85f42681e3aa47e1588e266557ae1b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 18 Jul 2003 14:04:49 +0000 Subject: [PATCH] fix for Angus' redraw problem. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7317 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formula.C | 14 +++++++------- src/mathed/formulabase.h | 2 -- src/rowpainter.C | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 7bc66335fc..d2a2aa98f1 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -278,21 +278,21 @@ void InsetFormula::metrics(MetricsInfo & m, Dimension & dim) const { view_ = m.base.bv; if (preview_->previewReady()) { - dim_.asc = preview_->pimage()->ascent(); - dim_.des = preview_->pimage()->descent(); + dim.asc = preview_->pimage()->ascent(); + dim.des = preview_->pimage()->descent(); // insert a one pixel gap in front of the formula - dim_.wid = 1 + preview_->pimage()->width(); + dim.wid = 1 + preview_->pimage()->width(); if (display()) - dim_.des += 12; + dim.des += 12; } else { MetricsInfo mi = m; mi.base.style = LM_ST_TEXT; mi.base.font.setColor(LColor::math); par()->metrics(mi, dim_); - dim_.asc += 1; - dim_.des += 1; + dim.asc += 1; + dim.des += 1; } - dim = dim_; + dim_ = dim; } diff --git a/src/mathed/formulabase.h b/src/mathed/formulabase.h index 8933c60275..75b40d6338 100644 --- a/src/mathed/formulabase.h +++ b/src/mathed/formulabase.h @@ -119,8 +119,6 @@ protected: mutable int xo_; /// mutable int yo_; - /// - mutable Dimension dim_; }; // We don't really mess want around with mathed stuff outside mathed. diff --git a/src/rowpainter.C b/src/rowpainter.C index 84d970678b..6980084b26 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -178,15 +178,15 @@ void RowPainter::paintInset(pos_type const pos) Assert(inset); - MetricsInfo mi(perv(bv_), getFont(pos), text_.workWidth()); - Dimension dim; - inset->metrics(mi, dim); + //MetricsInfo mi(perv(bv_), getFont(pos), text_.workWidth()); + //Dimension dim; + //inset->metrics(mi, dim); PainterInfo pi(perv(bv_)); pi.base.font = getFont(pos); #warning metrics? 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_); // FIXME: what is this fixing ? - if (text_.isInInset() && (x_ < 0)) + if (text_.isInInset() && x_ < 0) x_ = 0; x_ += xo_;