]> git.donarmstrong.com Git - lilypond.git/commitdiff
robustness: handle floating grace attached across line breaks. Fixes #203
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 31 Dec 2006 11:12:31 +0000 (12:12 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 31 Dec 2006 11:12:31 +0000 (12:12 +0100)
input/regression/spacing-loose-grace-linebreak.ly [new file with mode: 0644]
lily/spacing-loose-columns.cc

diff --git a/input/regression/spacing-loose-grace-linebreak.ly b/input/regression/spacing-loose-grace-linebreak.ly
new file mode 100644 (file)
index 0000000..182b854
--- /dev/null
@@ -0,0 +1,41 @@
+
+
+\header{
+  texidoc = "If a floating grace spacing section attaches to a note
+across a line break, it gets attached to the end of line."
+}
+
+
+\version "2.11.5"
+
+\new Score \with {
+  \override SpacingSpanner #'strict-grace-spacing = ##t
+  \override PaperColumn #'used = ##t 
+} <<
+
+  \new Staff <<
+
+    \new Voice {
+      \time 2/4    s2
+      \time 2/4    s2 \break
+      \time 2/4    s2
+    }
+
+    \new Voice {
+      b'4
+      \afterGrace c''4 {b'16}
+      s4
+      s4
+      c''4
+    }
+    \new Voice {
+      c'4
+      c'8.
+      r16
+      c'4
+      c'4
+      c'4
+    }
+  >>
+>>
+
index 94bc552e6f799ed47c3b8d9ad9b8668077ea6c43..c32b60639c32e8065ac2e8df541559d8ebeb9066 100644 (file)
@@ -66,9 +66,19 @@ set_loose_columns (System *which, Column_x_positions const *posns)
          loose = right = re->get_column ();
        }
 
-      if (!right->get_system ())
+      if (!right->get_system ()
+         && right->find_prebroken_piece (LEFT)
+         && right->find_prebroken_piece (LEFT)->get_system () == which)
        right = right->find_prebroken_piece (LEFT);
-
+      else if (Paper_column::get_rank (which->get_bound (RIGHT)) < Paper_column::get_rank (right))
+       
+       right = which->get_bound (RIGHT);
+      else
+       {
+         clique.back ()->programming_error ("Loose column does not have right side to attach to.");
+         right = which->get_bound (RIGHT);
+       }
+      
       Grob *common = right->common_refpoint (left, X_AXIS);
 
       clique.push_back (right);