]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/collision.cc
release: 1.3.8
[lilypond.git] / lily / collision.cc
index 6da2f27f8de99dbf340395a82afd998317df4f07..48148c21ef7b4c9c3d2df5cfedda2ae384c0f888 100644 (file)
@@ -10,7 +10,7 @@
 #include "note-column.hh"
 #include "note-head.hh"
 #include "paper-def.hh"
-#include "ly-symbols.hh"
+
 #include "tuple.hh"
 
 Collision::Collision()
@@ -33,7 +33,7 @@ Collision::do_pre_processing()
   Array<Shift_tup> hand (forced_shift ());
   Link_array<Note_column> done;
   
-  Real wid = paper_l ()->note_width ();
+  Real wid = paper_l ()->get_var ("collision_note_width");
   for (int i=0; i < hand.size (); i++)
     {
       hand[i].e1_->translate_axis (hand[i].e2_ *wid, X_AXIS);
@@ -52,8 +52,6 @@ Collision::do_pre_processing()
 
   This should be done better, probably.
 
-  TODO: forced hshift
-  
   */
 Array< Shift_tup >
 Collision::automatic_shift ()
@@ -80,19 +78,19 @@ Collision::automatic_shift ()
       for (int i=0; i < clashes.size (); i++)
        {
          SCM sh
-           = clashes[i]->remove_elt_property (horizontal_shift_scm_sym);
+           = clashes[i]->remove_elt_property ("horizontal-shift");
 
-         if (sh == SCM_BOOL_F)
-           shift.push (0);
+         if (gh_number_p (sh))
+           shift.push (gh_scm2int (sh));
          else
-           shift.push (gh_scm2int (SCM_CDR (sh)));
+           shift.push (0);
        }
       
       for (int i=1; i < shift.size (); i++)
        {
          if (shift[i-1] == shift[i])
            {
-             warning (_ ("Too many clashing notecolumns. Ignoring them."));
+             warning (_ ("Too many clashing notecolumns.  Ignoring them."));
              return tups;
            }
        }
@@ -178,12 +176,10 @@ Collision::forced_shift ()
   
   for (int i=0; i < clash_l_arr_.size (); i++)
     {
-      SCM force =  clash_l_arr_[i]->remove_elt_property (force_hshift_scm_sym);
-      if (force != SCM_BOOL_F)
+      SCM force =  clash_l_arr_[i]->remove_elt_property ("force-hshift");
+      if (force != SCM_UNDEFINED)
        {
-         force = SCM_CDR (force);
-         tups. push (Shift_tup (clash_l_arr_[i],
-                                                gh_scm2double (force)));
+         tups. push (Shift_tup (clash_l_arr_[i], gh_scm2double (force)));
        }
     }
   return tups;
@@ -200,3 +196,4 @@ Collision::do_substitute_element_pointer (Score_element*o_l,Score_element*n_l)
 
     }
 }
+