From 0777d41fefe7dfdc8caa470b8a97aa9e737ebb53 Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Thu, 23 Nov 2006 18:59:05 +0000 Subject: [PATCH] * insets/inset.h: * rowpainter.C: visualize deleted/inserted end-of-par characters (change tracking) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16017 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/inset.h | 2 +- src/rowpainter.C | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/insets/inset.h b/src/insets/inset.h index e7f4ea68f6..7832a32017 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -30,7 +30,7 @@ public: /// enum { /// - TEXT_TO_INSET_OFFSET = 2 + TEXT_TO_INSET_OFFSET = 4 }; /// diff --git a/src/rowpainter.C b/src/rowpainter.C index fdb3450e64..1c2f53bb23 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -637,7 +637,21 @@ void RowPainter::paintLast() bool const is_rtl = text_.isRTL(*bv_.buffer(), par_); int const endlabel = getEndLabel(pit_, text_.paragraphs()); + // paint imaginary end-of-paragraph character + + if (par_.isInserted(par_.size()) || par_.isDeleted(par_.size())) { + FontMetrics const & fm = theFontMetrics(bv_.buffer()->params().getFont()); + int const length = fm.maxAscent() / 2; + LColor::color col = par_.isInserted(par_.size()) ? LColor::newtext : LColor::strikeout; + + pain_.line(x_ + 1, yo_ + 2, x_ + 1, yo_ + 2 - length, col, + Painter::line_solid, Painter::line_thick); + pain_.line(x_ + 1 - length, yo_ + 2, x_ + 1, yo_ + 2, col, + Painter::line_solid, Painter::line_thick); + } + // draw an endlabel + switch (endlabel) { case END_LABEL_BOX: case END_LABEL_FILLED_BOX: { @@ -936,9 +950,9 @@ void paintPar rp.paintChangeBar(); if (rit == rb) rp.paintFirst(); + rp.paintText(); if (rit + 1 == re) rp.paintLast(); - rp.paintText(); } y += rit->descent(); // Restore, see above @@ -1020,7 +1034,7 @@ void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y) // lyxerr << " paintTextInset: y: " << y << endl; y -= text.getPar(0).ascent(); - // This flag can not be set from within same inset: + // This flag cannot be set from within same inset: bool repaintAll = refreshInside; for (int pit = 0; pit < int(text.paragraphs().size()); ++pit) { y += text.getPar(pit).ascent();