From f527d0a1342fa43d76df924d3f33bbb9e38be898 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 22 Mar 2005 10:57:10 +0000 Subject: [PATCH] fix drawing of change tracker strikeout git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9736 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/rowpainter.C | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2b44c46b54..321d4ce78c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-03-22 Jürgen Spitzmüller + + * rowpainter.C: use default text height for drawing change tracker + strikeout lines. + 2005-03-21 Jürgen Spitzmüller * lyx_main.C: fix binding of tabulator key (especially S-Tab). diff --git a/src/rowpainter.C b/src/rowpainter.C index f4485f889b..36c354a55c 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -664,10 +664,9 @@ void RowPainter::paintText() // if we reach the end of a struck out range, paint it // we also don't paint across things like tables if (running_strikeout && (highly_editable_inset || !is_struckout)) { - // FIXME this should take real text height into account, not - // the whole row including padding whitespace - //int const middle = yo_ + (- row_.ascent() + row_.top_of_text()) / 2; - int const middle = yo_ - row_.ascent() / 2; + // calculate 1/3 height of the buffer's default font + int const middle = + yo_ - font_metrics::maxAscent(text_.defaultfont_) / 3; pain_.line(last_strikeout_x, middle, int(x_), middle, LColor::strikeout, Painter::line_solid, Painter::line_thin); running_strikeout = false; @@ -718,9 +717,9 @@ void RowPainter::paintText() // if we reach the end of a struck out range, paint it if (running_strikeout) { - //top_of_text = font_metrics::maxAscent(font); - //int const middle = yo_ - top_of_text() / 2; - int const middle = yo_ - row_.ascent() / 2; + // calculate 1/3 height of the buffer's default font + int const middle = + yo_ - font_metrics::maxAscent(text_.defaultfont_) / 3; pain_.line(last_strikeout_x, middle, int(x_), middle, LColor::strikeout, Painter::line_solid, Painter::line_thin); running_strikeout = false; -- 2.39.2