]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-spanner.cc
Issue 2491: Macro for(UP_and_DOWN) and 3 similar.
[lilypond.git] / lily / spacing-spanner.cc
index 75dc166925eb5a2e6ab1d9057688eb277548c4d8..657ff0cd6a9d2b6541b87bfdd8f6a789dbdcf13b 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1999--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -261,8 +261,7 @@ set_column_rods (vector<Grob *> const &cols, Real padding)
           Real left_stickout = skys ? (*skys)[RIGHT].max_height () : 0.0;
           bool done = true;
 
-          Direction d = LEFT;
-          do
+          for (LEFT_and_RIGHT (d))
             {
               if (j < i - 1)
                 cur_dist[d] += distances[j];
@@ -287,8 +286,10 @@ set_column_rods (vector<Grob *> const &cols, Real padding)
 
               cur_dist[d] = max (cur_dist[d], dist);
               done = done && !touches;
+
+              if (!rb)
+                break;
             }
-          while (flip (&d) != LEFT && rb);
 
           /* we need the empty check for gregorian notation, where there are a lot of
              extraneous paper-columns that we need to skip over */
@@ -495,6 +496,12 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r,
   vector<Spring> springs;
   Spring spring;
 
+  Real full_measure_space = 0.0;
+  if (Paper_column::is_musical (r)
+      && l->break_status_dir () == CENTER
+      && fills_measure (me, l, r))
+    full_measure_space = robust_scm2double (l->get_property ("full-measure-extra-space"), 1.0);
+
   Moment dt = Paper_column::when_mom (r) - Paper_column::when_mom (l);
 
   if (dt == Moment (0, 0))
@@ -514,7 +521,8 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r,
           */
           assert (spacing_grob->get_column () == l);
 
-          springs.push_back (Staff_spacing::get_spacing (spacing_grob, r));
+          springs.push_back (Staff_spacing::get_spacing (spacing_grob, r,
+                                                         full_measure_space));
         }
     }
 
@@ -533,15 +541,6 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r,
       spring *= 0.8;
     }
 
-  if (Paper_column::is_musical (r)
-      && l->break_status_dir () == CENTER
-      && fills_measure (me, l, r))
-    {
-      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_compress_strength ();
-    }
-
   if (options->stretch_uniformly_ && l->break_status_dir () != RIGHT)
     {
       spring.set_min_distance (0.0);