From a3f70f11e5b0205b346c90bda3c24af3c8e9291e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 19 Jan 2005 08:42:32 +0000 Subject: [PATCH] restore top/bottom margins (bug 1761) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9495 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/text.C | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index e1660e0743..d6b60775c4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-01-11 Jean-Marc Lasgouttes + + * text.C (setHeightOfRow): add a margin at the top and bottom of + the document (bug 1761) + 2005-01-17 Angus Leeming * buffer.C (readFile): prepend the name of the "lyx2lyx" script diff --git a/src/text.C b/src/text.C index 1547bc6c52..089dceb5c2 100644 --- a/src/text.C +++ b/src/text.C @@ -1000,6 +1000,14 @@ void LyXText::setHeightOfRow(pit_type const pit, Row & row) 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); } -- 2.39.2