]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix centered dynamics with alignment-distance.
authorJoe Neeman <joeneeman@gmail.com>
Mon, 14 Dec 2009 23:58:11 +0000 (15:58 -0800)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 14 Dec 2009 23:59:47 +0000 (15:59 -0800)
input/regression/page-spacing-dynamics.ly [new file with mode: 0644]
lily/align-interface.cc
lily/page-layout-problem.cc
ly/engraver-init.ly

diff --git a/input/regression/page-spacing-dynamics.ly b/input/regression/page-spacing-dynamics.ly
new file mode 100644 (file)
index 0000000..b2f04d7
--- /dev/null
@@ -0,0 +1,20 @@
+\version "2.13.9"
+
+\header {
+  texidoc = "Dynamic centering still works with alignment-distances."
+}
+
+\score {
+  \new PianoStaff <<
+    \new Staff c'
+    \new Dynamics { s2\fff\> s4 s\!\pp }
+    \new Staff c'
+  >>
+  \layout {
+    \context {
+      \Score
+      \override NonMusicalPaperColumn #'line-break-system-details =
+        #'((alignment-distances . (20)))
+    }
+  }
+}
index 77bd54cb051d9cbc6903b501b36407632b28d4c0..db8dea4a90e73c0bcb682a63efc78074a079a5c6 100644 (file)
@@ -159,10 +159,6 @@ Align_interface::get_minimum_translations (Grob *me,
 
   get_skylines (me, &elems, a, pure, start, end, &skylines);
 
-  SCM forced_distances = ly_assoc_get (ly_symbol2scm ("alignment-distances"),
-                                      Page_layout_problem::get_details (me),
-                                      SCM_EOL);
-
   Real where = 0;
   Real default_padding = robust_scm2double (me->get_property ("padding"), 0.0);
   vector<Real> translates;
@@ -205,15 +201,6 @@ Align_interface::get_minimum_translations (Grob *me,
                                                          &min_distance,
                                                          ly_symbol2scm ("minimum-distance")))
                dy = max (dy, min_distance + stacking_dir*(last_spaceable_element_pos - where));
-
-             if (scm_is_pair (forced_distances))
-               {
-                 SCM forced_dist = scm_car (forced_distances);
-                 forced_distances = scm_cdr (forced_distances);
-
-                 if (scm_is_number (forced_dist))
-                   dy = scm_to_double (forced_dist) + stacking_dir * (last_spaceable_element_pos - where);
-               }
            }
        }
 
index 0fb646a68e57a1253781ebf68d20762fc7bc40e9..0bb80c1f5ee0f8aafb85cfb5fd73f7636d484b6a 100644 (file)
@@ -453,6 +453,7 @@ Page_layout_problem::find_system_offsets ()
 // Given two lines that are already spaced (the first and last
 // elements of loose_lines), distribute some unspaced lines between
 // them.
+// first_translation and last_translation are relative to the page.
 void
 Page_layout_problem::distribute_loose_lines (vector<Grob*> const &loose_lines,
                                             vector<Real> const &min_distances,
index 8414cbc7efdaf0b4e9f4e6dbb8065d2b4be20040..36f2c4a49cbab50497e1b16bba1f9b6bec08f54e 100644 (file)
@@ -384,6 +384,7 @@ a collection of staves, with a bracket in front and spanning bar lines."
   \override VerticalAxisGroup #'staff-affinity = #CENTER
   \override VerticalAxisGroup #'inter-staff-spacing = #'((space . 5) (padding . 0.5))
   \override TextScript #'font-shape = #'italic
+  \override DynamicLineSpanner #'Y-offset = #0
 
   \description "Holds a single line of dynamics, which will be
 centered between the staves surrounding this context."