]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/align-interface.cc
Doc-de: fix sectioning in essay.tely
[lilypond.git] / lily / align-interface.cc
index f27316bb278535ff049b3d736bebb9e2effb7025..2385b035fdb058eb3e7c228712c4f3adac586c43 100644 (file)
@@ -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,
@@ -264,34 +264,16 @@ Real
 Align_interface::get_pure_child_y_translation (Grob *me, Grob *ch, int start, int end)
 {
   extract_grob_set (me, "elements", all_grobs);
-  SCM dy_scm = me->get_property ("forced-distance");
+  vector<Real> translates = get_minimum_translations (me, all_grobs, Y_AXIS, true, start, end);
 
-  if (scm_is_number (dy_scm))
+  if (translates.size ())
     {
-      Real dy = scm_to_double (dy_scm) * robust_scm2dir (me->get_property ("stacking-dir"), DOWN);
-      Real pos = 0;
       for (vsize i = 0; i < all_grobs.size (); i++)
-       {
-         if (all_grobs[i] == ch)
-           return pos;
-         if (!Hara_kiri_group_spanner::has_interface (all_grobs[i])
-             || !Hara_kiri_group_spanner::request_suicide (all_grobs[i], start, end))
-           pos += dy;
-       }
+       if (all_grobs[i] == ch)
+         return translates[i];
     }
   else
-    {
-      vector<Real> translates = get_minimum_translations (me, all_grobs, Y_AXIS, true, start, end);
-
-      if (translates.size ())
-       {
-         for (vsize i = 0; i < all_grobs.size (); i++)
-           if (all_grobs[i] == ch)
-             return translates[i];
-       }
-      else
-       return 0;
-    }
+    return 0;
 
   programming_error ("tried to get a translation for something that is no child of mine");
   return 0;