]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 1385.
authorJoe Neeman <joeneeman@gmail.com>
Thu, 18 Nov 2010 04:56:19 +0000 (20:56 -0800)
committerJoe Neeman <joeneeman@gmail.com>
Thu, 18 Nov 2010 05:37:27 +0000 (21:37 -0800)
Make the page-layout algorithm aware of indentation.

lily/include/page-layout-problem.hh
lily/page-layout-problem.cc

index 83fab7d6167b5e33ae9456709d416576a2460f08..3cbf6eb30d8c6675e4722900410669336f9e78ca 100644 (file)
@@ -38,7 +38,7 @@ public:
   static Real get_fixed_spacing (Grob *before, Grob *after, int spaceable_index, bool pure, int start, int end);
 
 protected:
-  void append_system (System*, Spring const&, Real padding);
+  void append_system (System*, Spring const&, Real indent, Real padding);
   void append_prob (Prob*, Spring const&, Real padding);
 
   void solve_rod_spring_problem (bool ragged);
index 0fd9a92aa75dbfe2822924fd89e17ea36c05f5dc..8acef86cd53412b040ed4479cf17be0587db3ede 100644 (file)
@@ -27,6 +27,7 @@
 #include "output-def.hh"
 #include "paper-book.hh"
 #include "paper-column.hh"
+#include "paper-score.hh"
 #include "pointer-group-interface.hh"
 #include "prob.hh"
 #include "skyline-pair.hh"
@@ -117,10 +118,11 @@ Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst
 
          Spring spring (0, 0);
          Real padding = 0.0;
+         Real indent = line_dimensions_int (sys->paper_score ()->layout (), sys->get_rank ())[LEFT];
          alter_spring_from_spacing_spec (spec, &spring);
          read_spacing_spec (spec, &padding, ly_symbol2scm ("padding"));
 
-         append_system (sys, spring, padding);
+         append_system (sys, spring, indent, padding);
          last_system_was_title = false;
        }
       else if (Prob *p = unsmob_prob (scm_car (s)))
@@ -180,7 +182,7 @@ Page_layout_problem::set_footer_height (Real height)
 }
 
 void
-Page_layout_problem::append_system (System *sys, Spring const& spring, Real padding)
+Page_layout_problem::append_system (System *sys, Spring const& spring, Real indent, Real padding)
 {
   Grob *align = sys->get_vertical_alignment ();
   if (!align)
@@ -195,6 +197,8 @@ Page_layout_problem::append_system (System *sys, Spring const& spring, Real padd
   Skyline up_skyline (UP);
   Skyline down_skyline (DOWN);
   build_system_skyline (elts, minimum_offsets, &up_skyline, &down_skyline);
+  up_skyline.shift (indent);
+  down_skyline.shift (indent);
 
   Real minimum_distance = up_skyline.distance (bottom_skyline_) + padding;