]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/align-interface.cc
Don't let lyrics interfere with StaffGrouper.
[lilypond.git] / lily / align-interface.cc
index f090cfd1e037b224e68d083f8ba578b210ff63b2..6d7c34d62143037569b2025881219aae99793575 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2000--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2000--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -177,7 +177,7 @@ Align_interface::get_minimum_translations (Grob *me,
          down_skyline.merge (skylines[j-1][stacking_dir]);
          dy = down_skyline.distance (skylines[j][-stacking_dir]);
 
-         SCM spec = Page_layout_problem::get_spacing_spec (elems[j-1], elems[j]);
+         SCM spec = Page_layout_problem::get_spacing_spec (elems[j-1], elems[j], pure, start, end);
          Page_layout_problem::read_spacing_spec (spec, &padding, ly_symbol2scm ("padding"));
 
          Real min_distance = 0;
@@ -189,7 +189,7 @@ Align_interface::get_minimum_translations (Grob *me,
              // Spaceable staves may have min-distance and padding
              // constraints coming from the previous spaceable staff
              // as well as from the previous staff.
-             spec = Page_layout_problem::get_spacing_spec (last_spaceable_element, elems[j]);
+             spec = Page_layout_problem::get_spacing_spec (last_spaceable_element, elems[j], pure, start, end);
              Real spaceable_padding = 0;
              Page_layout_problem::read_spacing_spec (spec,
                                                      &spaceable_padding,
@@ -240,9 +240,13 @@ void
 Align_interface::align_elements_to_ideal_distances (Grob *me)
 {
   System *sys = me->get_system ();
-  Page_layout_problem layout (NULL, SCM_EOL, scm_list_1 (sys->self_scm ()));
-
-  layout.solution (true);
+  if (sys)
+    {
+      Page_layout_problem layout (NULL, SCM_EOL, scm_list_1 (sys->self_scm ()));
+      layout.solution (true);
+    }
+  else
+    programming_error ("vertical alignment called before line breaking");
 }
 
 void