#include "note-column.hh"
#include "note-head.hh"
#include "paper-def.hh"
-#include "ly-symbols.hh"
+
#include "tuple.hh"
Collision::Collision()
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);
This should be done better, probably.
- TODO: forced hshift
-
*/
Array< Shift_tup >
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;
}
}
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;
}
}
+