]> git.lyx.org Git - features.git/commitdiff
restore top/bottom margins (bug 1761)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 19 Jan 2005 08:42:32 +0000 (08:42 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 19 Jan 2005 08:42:32 +0000 (08:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9495 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text.C

index e1660e07439ef2995b830f16bccc5ea85c50ade7..d6b60775c44c8eda1fb2a1406e56ee5aa70813d4 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-11  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * text.C (setHeightOfRow): add a margin at the top and bottom of
+       the document (bug 1761)
+
 2005-01-17  Angus Leeming  <leeming@lyx.org>
 
        * buffer.C (readFile): prepend the name of the "lyx2lyx" script
index 1547bc6c52199feffb0b3e1f6b709fc7aa74300c..089dceb5c274ff9b055c840d5fca7038c269b1c1 100644 (file)
@@ -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);
 }