Better fix than revision 22553. Transfer the backup to RowPainter::paintInset().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22554 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-01-14 16:24:01 +00:00
parent cb83883583
commit f643441cf2
2 changed files with 7 additions and 5 deletions

View File

@ -1895,15 +1895,10 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co
// Don't paint the row if a full repaint has not been requested
// and if it has not changed.
if (!pi.full_repaint && !row_has_changed) {
// Backup full_repaint status because some Inset (InsetTabular)
// requires a full repaint
bool tmp = pi.full_repaint;
// Paint only the insets if the text itself is
// unchanged.
rp.paintOnlyInsets();
y += row.descent();
// Restore full_repaint status.
pi.full_repaint = tmp;
continue;
}

View File

@ -96,6 +96,10 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
Font const font = text_metrics_.getDisplayFont(pit_, pos);
BOOST_ASSERT(inset);
// Backup full_repaint status because some insets (InsetTabular)
// requires a full repaint
bool pi_full_repaint = pi_.full_repaint;
// FIXME: We should always use font, see documentation of
// noFontChange() in Inset.h.
pi_.base.font = inset->noFontChange() ?
@ -114,6 +118,9 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
x_ += dim.width();
// Restore full_repaint status.
pi_.full_repaint = pi_full_repaint;
#ifdef DEBUG_METRICS
int const x1 = int(x_ - dim.width());
Dimension dim2;