Lars Gullik Bjønnes wrote:
> Is it not possible to get rid of the '13'?

Yes it is. See me updated patch (reattached to this mail).

Jürgen

P.S.: I found out that 1/3 of the font maxAscent gives the best result for 
different font sizes, but also to the default size.
Index: rowpainter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v
retrieving revision 1.142
diff -u -r1.142 rowpainter.C
--- rowpainter.C	15 Feb 2005 19:34:44 -0000	1.142
+++ rowpainter.C	21 Mar 2005 10:08:29 -0000
@@ -664,10 +664,9 @@
 		// 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/2 height of the buffer's default font
+			int const middle =
+				yo_ - font_metrics::maxAscent(text_.defaultfont_) / 2;
 			pain_.line(last_strikeout_x, middle, int(x_), middle,
 				LColor::strikeout, Painter::line_solid, Painter::line_thin);
 			running_strikeout = false;
@@ -718,9 +717,9 @@
 
 	// 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/2 height of the buffer's default font
+		int const middle =
+			yo_ - font_metrics::maxAscent(text_.defaultfont_) / 2;
 		pain_.line(last_strikeout_x, middle, int(x_), middle,
 			LColor::strikeout, Painter::line_solid, Painter::line_thin);
 		running_strikeout = false;

Reply via email to