]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-spanner.cc
Fix 441.
[lilypond.git] / lily / spacing-spanner.cc
index 4a6d0b05156dd602f7bcefde0261f539f00ad0aa..446c1413cdbe984fc61ea411d0eb704d2ffee53e 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1999--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1999--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "spacing-spanner.hh"
@@ -405,8 +405,20 @@ Spacing_spanner::musical_column_spacing (Grob *me,
        Note that we don't actually pack things as tightly as possible:
        we don't allow the next column to begin before this one ends.
       */
-      spring.set_distance (max (left_col->extent (left_col, X_AXIS)[RIGHT],
-                               spring.min_distance ()));
+      /* FIXME: the else clause below is the "right" thing to do,
+        but we can't do it because of all the empty columns that the
+        ligature-engravers leave lying around. In that case, the extent of
+        the column is incorrect because it includes note-heads that aren't
+        there. We get around this by only including the column extent if
+        the left-hand column is "genuine". This is a dirty hack and it
+        should be fixed in the ligature-engravers. --jneem
+      */
+      if (Paper_column::is_extraneous_column_from_ligature (left_col))
+       spring.set_distance (spring.min_distance ());
+      else
+       spring.set_distance (max (left_col->extent (left_col, X_AXIS)[RIGHT],
+                                 spring.min_distance ()));
+
       spring.set_inverse_stretch_strength (1.0);
     }
 
@@ -501,7 +513,8 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r,
       && l->break_status_dir () == CENTER
       && fills_measure (me, l, r))
     {
-      spring.set_distance (spring.distance () + 1.0);
+      Real full_measure_extra_space = robust_scm2double (l->get_property ("full-measure-extra-space"), 1.0);
+      spring.set_distance (spring.distance () + full_measure_extra_space);
       spring.set_default_strength ();
     }