]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/separation-item.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / separation-item.cc
index 0f1d4610213b14c0734688c3ac5279512ffcef87..c0536b6ce3ab69b95f545b860d45ba65a707ee8e 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1998--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "separation-item.hh"
@@ -35,7 +35,7 @@ Separation_item::set_skyline_distance (Drul_array<Item *> items,
                                   Skyline_pair::unsmob (items[RIGHT]->get_property ("skylines")));
   Skyline right = conditional_skyline (items[RIGHT], items[LEFT]);
   right.merge ((*lines[RIGHT])[LEFT]);
-
+  
   Real dist = padding + (*lines[LEFT])[RIGHT].distance (right);
   if (dist > 0)
     {
@@ -91,7 +91,13 @@ Separation_item::boxes (Grob *me, Grob *left)
   int very_large = INT_MAX;
   Paper_column *pc = item->get_column ();
   vector<Box> out;
-  extract_grob_set (me, left ? "conditional-elements" : "elements", elts);
+  extract_grob_set (me, left ? "conditional-elements" : "elements", read_only_elts);
+  vector<Grob*> elts;
+
+  if (left)
+    elts = Accidental_placement::get_break_reminder_accidentals (read_only_elts, left);
+  else
+    elts = read_only_elts;
 
   Grob *ycommon = common_refpoint_of_array (elts, me, Y_AXIS);
   
@@ -103,22 +109,16 @@ Separation_item::boxes (Grob *me, Grob *left)
          continue;
        }
 
-      if (to_boolean (il->get_property ("no-spacing-rods")))
-       continue;
-
       Interval y (il->pure_height (ycommon, 0, very_large));
-      Interval x;
-      
-      if (!left)
-       x = il->extent (pc, X_AXIS);
-      else if (Accidental_placement::has_interface (il))
-       x = Accidental_placement::get_relevant_accidental_extent (il, pc, left);
-      else
-       continue;
-
-      SCM padding = elts[i]->get_property ("padding");
-      x.widen (robust_scm2double (padding, 0));
-
+      Interval x (il->extent (pc, X_AXIS));
+
+      Interval extra = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"),
+                                           Interval (0, 0));
+      x[LEFT] += extra[LEFT];
+      x[RIGHT] += extra[RIGHT];
+      if (to_boolean (elts[i]->get_property ("infinite-spacing-height")))
+       y = Interval (-infinity_f, infinity_f);
       out.push_back (Box (x, y));
     }