]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-spacing.cc
* lily/accidental-placement.cc (split_accidentals): new function
[lilypond.git] / lily / note-spacing.cc
index 95ba49aa64a7a271f06dd4261dddb62ace9e0cbf..8d2ac6e0a794e913100f357afe29471f80f4504d 100644 (file)
@@ -17,7 +17,7 @@
 #include "stem.hh"
 #include "separation-item.hh"
 #include "staff-spacing.hh"
-
+#include "accidental-placement.hh"
 
 void
 Note_spacing::get_spacing (Grob *me, Item* right_col,
@@ -55,7 +55,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
          
          if (Separation_item::has_interface (it))
            {
-             extents[d].unite (Separation_item::my_width (it));
+             extents[d].unite (Separation_item::width (it));
              continue;
            }
 
@@ -78,7 +78,12 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
                accs = Note_column::accidentals (it->get_parent (X_AXIS));
              
              if (accs)
-               extents[d].unite (accs->extent (it_col, X_AXIS));
+               {
+                 Interval v =
+                   Accidental_placement::get_relevant_accidental_extent (accs, it_col, me);
+                   
+                 extents[d].unite (v);
+               }
            }
        }
 
@@ -119,7 +124,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
 Item *
 Note_spacing::left_column (Grob *me)
 {
-  if (me->immutable_property_alist_ == SCM_EOL)
+  if (!me->live())
     return 0;
   
   return dynamic_cast<Item*> (me)->column_l ();
@@ -136,10 +141,7 @@ prune RIGHT-ITEMS.
 Item *
 Note_spacing::right_column (Grob*me)
 {
-  /*
-    ugh. should have generic is_live() method?
-   */
-  if (me->immutable_property_alist_ == SCM_EOL)
+  if (!me->live())
     return 0;
   
   SCM right = me->get_grob_property ("right-items");