lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adds footnote-footer-padding to the paper bloc. (issue4384046)


From: mtsolo
Subject: Adds footnote-footer-padding to the paper bloc. (issue4384046)
Date: Fri, 08 Apr 2011 02:14:44 +0000

Reviewers: ,

Message:
Fixes the problem flagged by Reinhold regarding the spacing between the
footer and the footnotes by adding footnote-footer-padding to the paper
bloc.

Description:
Adds footnote-footer-padding to the paper bloc.

Please review this at http://codereview.appspot.com/4384046/

Affected files:
  M lily/include/page-breaking.hh
  M lily/page-breaking.cc
  M lily/page-layout-problem.cc
  M lily/page-spacing.cc
  M ly/paper-defaults-init.ly


Index: lily/include/page-breaking.hh
diff --git a/lily/include/page-breaking.hh b/lily/include/page-breaking.hh
index fa68c6175207068f4543498ec5262ca1fc352089..17f64d754b87089b324263e4ea8d1b875ba75286 100644
--- a/lily/include/page-breaking.hh
+++ b/lily/include/page-breaking.hh
@@ -126,6 +126,7 @@ public:
   vsize system_count () const;
   Real footnote_separator_stencil_height () const;
   Real footnote_padding () const;
+  Real footnote_footer_padding () const;
   Real line_count_penalty (int line_count) const;
   int line_count_status (int line_count) const;
   bool too_many_lines (int line_count) const;
@@ -189,6 +190,7 @@ private:
   vsize system_count_;
   Real footnote_separator_stencil_height_;
   Real footnote_padding_;
+  Real footnote_footer_padding_;
   int orphan_penalty_;

   vector<Line_division> current_configurations_;
Index: lily/page-breaking.cc
diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc
index 80702f59ba2e3517aa8afd8fd1f3acb9d790a9af..fe1d163658a548f7a59489c348bf3eadb8ea91cf 100644
--- a/lily/page-breaking.cc
+++ b/lily/page-breaking.cc
@@ -263,6 +263,7 @@ Page_breaking::Page_breaking (Paper_book *pb, Break_predicate is_break, Prob_bre
     footnote_separator_stencil_height_ = 0.0;

footnote_padding_ = robust_scm2double (pb->paper_->c_variable ("footnote-padding"), 0.0); + footnote_footer_padding_ = robust_scm2double (pb->paper_->c_variable ("footnote-footer-padding"), 0.0);

if (systems_per_page_ && (max_systems_per_page_ || min_systems_per_page_))
     {
@@ -335,6 +336,12 @@ Page_breaking::footnote_padding () const
   return footnote_padding_;
 }

+Real
+Page_breaking::footnote_footer_padding () const
+{
+  return footnote_footer_padding_;
+}
+
 bool
 Page_breaking::too_many_lines (int line_count) const
 {
Index: lily/page-layout-problem.cc
diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc
index c9512fcca83a9d6908ae8237a048f47985a1fc98..9d17494c4dac4df6c1b6cf5f8d0611aded030ac2 100644
--- a/lily/page-layout-problem.cc
+++ b/lily/page-layout-problem.cc
@@ -71,7 +71,7 @@ Page_layout_problem::get_footnotes_from_lines (SCM lines, Real padding)

   if (!scm_is_pair (footnotes))
     return SCM_EOL;
-
+
   return scm_reverse (footnotes);
 }

@@ -99,8 +99,10 @@ Page_layout_problem::add_footnotes_to_footer (SCM footnotes, Stencil *foot, Pape
 {
   bool footnotes_found = false;
Real footnote_padding = robust_scm2double (pb->paper_->c_variable ("footnote-padding"), 0.0); + Real footnote_footer_padding = robust_scm2double (pb->paper_->c_variable ("footnote-footer-padding"), 0.0);

   footnotes = scm_reverse (footnotes);
+
   for (SCM s = footnotes; scm_is_pair (s); s = scm_cdr (s))
     {
       Stencil *stencil = unsmob_stencil (scm_car (s));
@@ -110,7 +112,7 @@ Page_layout_problem::add_footnotes_to_footer (SCM footnotes, Stencil *foot, Pape

       if (!stencil->is_empty ())
         {
-          foot->add_at_edge (Y_AXIS, UP, *stencil, footnote_padding);
+ foot->add_at_edge (Y_AXIS, UP, *stencil, (!footnotes_found ? footnote_footer_padding : footnote_padding));
           footnotes_found = true;
         }
     }
Index: lily/page-spacing.cc
diff --git a/lily/page-spacing.cc b/lily/page-spacing.cc
index 13c6a0c02a98f45cd0d9208e4a13f2e61fe315c5..b09e612da466ef40a164325d30b6111075152211 100644
--- a/lily/page-spacing.cc
+++ b/lily/page-spacing.cc
@@ -83,8 +83,9 @@ Page_spacing::account_for_footnotes (Line_details const &line)
       Interval extent = line.footnotes_[i]->extent (Y_AXIS);
       footnote_height += extent[UP] - extent[DOWN];
       footnote_height += breaker_->footnote_padding ();
-    }
-  return footnote_height;
+    }
+
+ return footnote_height - breaker_->footnote_padding () + breaker_->footnote_footer_padding ();
 }

 void
Index: ly/paper-defaults-init.ly
diff --git a/ly/paper-defaults-init.ly b/ly/paper-defaults-init.ly
index 61750d2159db7a001024b406ea67db996ebb12c1..533a2deaebd62e28da8433e2016a0052c682b08c 100644
--- a/ly/paper-defaults-init.ly
+++ b/ly/paper-defaults-init.ly
@@ -108,7 +108,7 @@
   %%
footnote-separator-markup = \markup { \fill-line \override #`(span-factor . 1/2) { \draw-hline } }
   footnote-padding = 0.5\mm
-
+  footnote-footer-padding = 0.5\mm

   %%
   %% Page numbering





reply via email to

[Prev in Thread] Current Thread [Next in Thread]