>>>>> "michael" == michael gerz <[EMAIL PROTECTED]> writes:

michael> Hello, in a "g-brief-de" document, the top label "Brieftext"
michael> (letter text) is printed too low (BUG!). Yesterday, I looked
michael> at the LyX code and discovered the reason. The problem is
michael> that RowPainter::paintFirst (line 515) does not regard the
michael> ascent of the row's text. However, row_.ascent() cannot be
michael> used as offset because it already includes the height of the
michael> label itself (and possibly the height of other elements such
michael> as the append marker).

I think this is the right fix (I copied the code used for chapter).

Could you try it?

JMarc

Index: src/rowpainter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v
retrieving revision 1.155
diff -u -p -r1.155 rowpainter.C
--- src/rowpainter.C	7 Sep 2005 10:37:00 -0000	1.155
+++ src/rowpainter.C	16 Sep 2005 13:13:52 -0000
@@ -489,9 +489,7 @@ void RowPainter::paintFirst()
 				} else {
 					spacing_val = buffer.params().spacing().getValue();
 				}
-#ifdef WITH_WARNINGS
-#warning Look is this correct?
-#endif
+
 				int const labeladdon = int(font_metrics::maxHeight(font) * layout->spacing.getValue() * spacing_val);
 
 				int const maxdesc = int(font_metrics::maxDescent(font) * layout->spacing.getValue() * spacing_val)
@@ -531,6 +529,8 @@ void RowPainter::paintFirst()
 			else
 				spacing_val = buffer.params().spacing().getValue();
 
+			int const labeladdon = int(font_metrics::maxHeight(font) * layout->spacing.getValue() * spacing_val);
+
 			int maxdesc =
 				int(font_metrics::maxDescent(font) * layout->spacing.getValue() * spacing_val
 				+ (layout->labelbottomsep * defaultRowHeight()));
@@ -544,7 +544,7 @@ void RowPainter::paintFirst()
 				x = width_ - leftMargin() -
 					font_metrics::width(str, font);
 			}
-			pain_.text(int(x), yo_ - maxdesc, str, font);
+			pain_.text(int(x), yo_ - maxdesc - labeladdon, str, font);
 		}
 	}
 }

Reply via email to