From: Joe Neeman <joeneeman@gmail.com>
Date: Wed, 2 Mar 2011 12:27:44 +0000 (+1100)
Subject: Revert "Fix 1442."
X-Git-Tag: release/2.13.53-1~31
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=999b5321b8a9ba9a2b01e792ba710a2f6b710d51;p=lilypond.git

Revert "Fix 1442."

This reverts commit c49d47e3859b857885408a9deda16a9973eb1e21.
---

diff --git a/lily/align-interface.cc b/lily/align-interface.cc
index cabce9e974..cb876f5bbf 100644
--- a/lily/align-interface.cc
+++ b/lily/align-interface.cc
@@ -167,13 +167,12 @@ Align_interface::get_minimum_translations_without_min_dist (Grob *me,
   return internal_get_minimum_translations (me, all_grobs, a, false, false, 0, 0);
 }
 
-// If include_fixed_spacing is false, the only constraints that will be measured
-// here are those that result from collisions (+ padding).  That is, all
-// minimum-distances, line-break-system-details, basic-distance+stretchable=0
-// constraints will be ignored.
-// - If you want to find the minimum height of a system, include_fixed_spacing should be true.
-// - If you're going to actually lay out the page, then it should be false (or
-//   else centered dynamics will break when there is a fixed alignment).
+// If include_fixed_spacing is true, the manually fixed spacings
+// induced by stretchable=0 or alignment-distances are included
+// in the minimum translations here.  If you want to find the minimum
+// height of a system, include_fixed_spacing should be true.  If you
+// want to actually lay out the page, then it should be false (or
+// else centered dynamics will break when there is a fixed alignment).
 vector<Real>
 Align_interface::internal_get_minimum_translations (Grob *me,
 						    vector<Grob*> const &all_grobs,
@@ -213,14 +212,12 @@ Align_interface::internal_get_minimum_translations (Grob *me,
 	  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"));
 
-	  if (include_fixed_spacing)
-	    {
-	      Real min_distance = 0;
-	      if (Page_layout_problem::read_spacing_spec (spec, &min_distance, ly_symbol2scm ("minimum-distance")))
-		dy = max (dy, min_distance);
+	  Real min_distance = 0;
+	  if (Page_layout_problem::read_spacing_spec (spec, &min_distance, ly_symbol2scm ("minimum-distance")))
+	    dy = max (dy, min_distance);
 
-	      dy = max (dy, Page_layout_problem::get_fixed_spacing (elems[j-1], elems[j], spaceable_count, pure, start, end));
-	    }
+	  if (include_fixed_spacing)
+	    dy = max (dy, Page_layout_problem::get_fixed_spacing (elems[j-1], elems[j], spaceable_count, pure, start, end));
 
 	  if (Page_layout_problem::is_spaceable (elems[j]) && last_spaceable_element)
 	    {
@@ -234,17 +231,15 @@ Align_interface::internal_get_minimum_translations (Grob *me,
 						      ly_symbol2scm ("padding"));
 	      padding = max (padding, spaceable_padding);
 
+	      Real min_distance = 0;
+	      if (Page_layout_problem::read_spacing_spec (spec,
+							  &min_distance,
+							  ly_symbol2scm ("minimum-distance")))
+		dy = max (dy, min_distance + stacking_dir*(last_spaceable_element_pos - where));
+
 	      if (include_fixed_spacing)
-		{
-		  Real min_distance = 0;
-		  if (Page_layout_problem::read_spacing_spec (spec,
-							      &min_distance,
-							      ly_symbol2scm ("minimum-distance")))
-		    dy = max (dy, min_distance + stacking_dir*(last_spaceable_element_pos - where));
-
-		  dy = max (dy, Page_layout_problem::get_fixed_spacing (last_spaceable_element, elems[j], spaceable_count,
-									pure, start, end));
-		}
+		dy = max (dy, Page_layout_problem::get_fixed_spacing (last_spaceable_element, elems[j], spaceable_count,
+								      pure, start, end));
 	    }
 	}
 
diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc
index 3aebfd4aac..aaf86815dc 100644
--- a/lily/page-layout-problem.cc
+++ b/lily/page-layout-problem.cc
@@ -424,7 +424,8 @@ Page_layout_problem::find_system_offsets ()
 		      loose_line_min_distances.clear ();
 		    }
 		  last_spaceable_line = staff;
-		  last_spaceable_line_translation = -solution_[spring_idx - 1];
+		  // Negative is down but the translation is relative to the whole page.
+		  last_spaceable_line_translation = -system_position + translation;
 
 		  staff->translate_axis (translation, Y_AXIS);
 		  found_spaceable_staff = true;
@@ -435,10 +436,6 @@ Page_layout_problem::find_system_offsets ()
 		    loose_lines.push_back (last_spaceable_line);
 
 		  if (staff_idx)
-		    // NOTE: the way we do distances between loose lines (and other lines too, actually)
-		    // is not the most accurate way possible: we only insert rods between adjacent
-		    // lines.  To be more accurate, we could insert rods between non-adjacent lines
-		    // using a scheme similar to the one in set_column_rods.
 		    loose_line_min_distances.push_back (min_offsets[staff_idx-1] - min_offsets[staff_idx]);
 		  else
 		    {