]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dot-column.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / dot-column.cc
index 2d01faa0268db39e3d16d74c4177ec5e7fd1d659..a07dfcde116c132bd7aa1e64958ca22896da9dd2 100644 (file)
 using namespace std;
 
 #include "dots.hh"
+#include "dot-column.hh"
 #include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "directional-element-interface.hh"
 #include "side-position-interface.hh"
 #include "axis-group-interface.hh"
 #include "stem.hh"
+#include "grob.hh"
 #include "pointer-group-interface.hh"
 
 /*
@@ -31,21 +33,27 @@ SCM
 Dot_column::side_position (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Grob *stem = unsmob_grob (me->get_object ("stem"));
-  if (stem
-      && !Stem::get_beam (stem)
-      && Stem::duration_log (stem) > 2
-      && !Stem::is_invisible (stem))
+  extract_grob_set (me, "dots", dots);
+  
+  for (vsize i = 0; i  < dots.size (); i++)
     {
-      /*
-       trigger stem end & direction calculation.
-
-       This will add the stem to the support if a flag collision happens.
-      */
-      stem->get_property ("stem-end-position");
+      Grob *head = dots[i]->get_parent (Y_AXIS);
+      Grob *stem = head ? unsmob_grob (head->get_object ("stem")) : 0;
+      if (stem
+         && !Stem::get_beam (stem)
+         && Stem::duration_log (stem) > 2
+         && !Stem::is_invisible (stem))
+       {
+         /*
+           trigger stem end & direction calculation.
+           
+           This will add the stem to the support if a flag collision happens.
+         */
+         stem->get_property ("stem-end-position");
+       }
     }
-  
-  return Side_position_interface::x_aligned_side (smob);
+
+  return Side_position_interface::x_aligned_side (smob, SCM_EOL);
 }
 
 struct Dot_position
@@ -60,6 +68,7 @@ struct Dot_position
     dot_ = 0;
     pos_ = 0;
     dir_ = CENTER;
+    extremal_head_ = false;
   }
 };
 
@@ -227,7 +236,7 @@ Dot_column::calc_positioning_done (SCM smob)
       }
   }
 
-  vector_sort (dots, &compare_position);
+  vector_sort (dots, position_less);
   for (vsize i = dots.size (); i--;)
     if (!dots[i]->is_live ())
       dots.erase (dots.begin () + i);
@@ -284,13 +293,13 @@ Dot_column::add_head (Grob *me, Grob *rh)
 }
 
 ADD_INTERFACE (Dot_column,
-              "dot-column-interface",
               
               "Groups dot objects so they form a column, and position dots so they do not "
               "clash with staff lines ",
 
               /* properties */
+              "dots "
               "positioning-done "
               "direction "
-              "stem");
+              );