Is it as simple as that?

JMarc

Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2081
diff -u -p -r1.2081 ChangeLog
--- src/ChangeLog	10 Jan 2005 19:17:38 -0000	1.2081
+++ src/ChangeLog	11 Jan 2005 14:30:02 -0000
@@ -1,3 +1,8 @@
+2005-01-11  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* text.C (setHeightOfRow): add a margin at the top and bottom of
+	the document (bug 1761)
+
 2005-01-10  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* Makefile.am: remove the lyx_main.C special casing.
Index: src/text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.591
diff -u -p -r1.591 text.C
--- src/text.C	6 Jan 2005 16:39:28 -0000	1.591
+++ src/text.C	11 Jan 2005 14:30:02 -0000
@@ -1000,6 +1000,14 @@ void LyXText::setHeightOfRow(pit_type co
 	maxasc  += int(layoutasc  * 2 / (2 + pars_[pit].getDepth()));
 	maxdesc += int(layoutdesc * 2 / (2 + pars_[pit].getDepth()));
 
+	// Top and bottom margin of the document (only at top-level)
+	if (bv_owner->text() == this) {
+		if (pit == 0 && row.pos() == 0)
+			maxasc += 20;
+		if (pit == pars_.size() - 1 && row.endpos() == par.size())
+			maxdesc += 20;
+	}
+
 	row.ascent(maxasc + labeladdon);
 	row.descent(maxdesc);
 }

Reply via email to