]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dot-column.cc
(music_property_def): oops. SCM_UNDEFINED
[lilypond.git] / lily / dot-column.cc
index beff0f4f0f15fa226fc9a4f17b3d3573e43276b2..7c691c5ca791485899b29f4f952f0765e02b2454 100644 (file)
@@ -3,10 +3,10 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include <set>
+#include <stdio.h>
 #include <map>
 
 #include "dots.hh"
@@ -19,8 +19,6 @@
 #include "axis-group-interface.hh"
 #include "stem.hh"
 
-using std::set;
-
 /*
   TODO: let Dot_column communicate with stem via Note_column.
  */
@@ -34,9 +32,9 @@ Dot_column::force_shift_callback (SCM element_smob, SCM axis)
   assert (a == Y_AXIS);
   me = me->get_parent (X_AXIS);
 
-  if (!to_boolean (me->get_grob_property ("collision-done")))
+  if (!to_boolean (me->get_grob_property ("positioning-done")))
     {
-      me->set_grob_property ("collision-done", SCM_BOOL_T);
+      me->set_grob_property ("positioning-done", SCM_BOOL_T);
   
       do_shifts (me);
     }
@@ -55,7 +53,7 @@ Dot_column::side_position (SCM element_smob, SCM axis)
   if (stem
       && !Stem::get_beam (stem)
       && Stem::duration_log (stem) > 2
-      && !Stem::invisible_b (stem)
+      && !Stem::is_invisible (stem)
       )
     {
       /*
@@ -233,6 +231,26 @@ Dot_column::do_shifts (Grob*me)
 {
   Link_array<Grob> dots =
     Pointer_group_interface__extract_grobs (me, (Grob*)0, "dots");
+
+  { /*
+      Trigger note collision resolution first, since that may kill off
+      dots when merging.
+     */
+    Grob * c = 0;
+    for (int i = dots.size (); i-- ; )
+      {
+       Grob * n = dots[i]->get_parent (Y_AXIS);
+       if (c)
+         c = n->common_refpoint (c, X_AXIS);
+       else
+         c = n;
+      }
+    for (int i = dots.size (); i-- ; )
+      {
+       Grob * n = dots[i]->get_parent (Y_AXIS);
+       n->relative_coordinate (c ,  X_AXIS);
+      }
+  }
   
   dots.sort (compare_position);
   for (int i = dots.size (); i--;)
@@ -292,6 +310,8 @@ Dot_column::add_head (Grob * me, Grob *rh)
 
 
 ADD_INTERFACE (Dot_column, "dot-column-interface",
-  "Interface that groups dots so they form a column",
-  "collision-done direction stem");
+              "Groups dot objects so they form a column, and position dots so they do not "
+              "clash with staff lines "
+              ,
+              "positioning-done direction stem");