vector<int> ups = Stem::note_head_positions (stems[UP]);
vector<int> dps = Stem::note_head_positions (stems[DOWN]);
+ int threshold = robust_scm2int (me->get_property ("note-collision-threshold"), 1);
+
/* Too far apart to collide. */
- if (ups[0] > dps.back () + 1)
+ if (ups[0] > dps.back () + threshold)
return 0.0;
/* If the chords just 'touch' their extreme noteheads,
*/
bool touch = false;
if (ups[0] >= dps.back ()
- && (dps.size () < 2 || ups[0] >= dps[dps.size () - 2] + 2)
- && (ups.size () < 2 || ups[1] >= dps.back () + 2))
+ && (dps.size () < 2 || ups[0] >= dps[dps.size () - 2] + threshold + 1)
+ && (ups.size () < 2 || ups[1] >= dps.back () + threshold + 1))
touch = true;
/* Filter out the 'o's in this configuration, since they're no
for (vsize i = 0, j = 0; i < ups.size () && j < dps.size ();)
{
- if (abs (ups[i] - dps[j]) == 1)
+ if (ups[i] == dps[j])
+ full_collide = true;
+ else if (abs (ups[i] - dps[j]) <= threshold)
{
merge_possible = false;
if (ups[i] > dps[j])
else
distant_half_collide = true;
}
- else if (ups[i] == dps[j])
- full_collide = true;
else if (ups[i] > dps[0] && ups[i] < dps.back ())
merge_possible = false;
else if (dps[j] > ups[0] && dps[j] < ups.back ())
{
Grob *d = unsmob<Grob> (head_up->get_object ("dot"));
Grob *parent = d->get_parent (X_AXIS);
- if (Dot_column::has_interface (parent))
+ if (has_interface<Dot_column> (parent))
Side_position_interface::add_support (parent, head_down);
}
else if (Rhythmic_head::dot_count (head_down))
{
Grob *d = unsmob<Grob> (head_down->get_object ("dot"));
Grob *parent = d->get_parent (X_AXIS);
- if (Dot_column::has_interface (parent))
+ if (has_interface<Dot_column> (parent))
{
Grob *stem = unsmob<Grob> (head_up->get_object ("stem"));
// Loop over all heads on an up-pointing-stem to see if dots
}
vector<Grob *> done;
- Real left_most = 1e6;
+ Real left_most = 0.0;
vector<Real> amounts;
for (; scm_is_pair (hand); hand = scm_cdr (hand))
done.push_back (s);
amounts.push_back (amount);
- if (amount < left_most)
- left_most = amount;
}
for (; scm_is_pair (autos); autos = scm_cdr (autos))
{
for (vsize i = 0; i < elements.size (); i++)
{
Grob *se = elements[i];
- if (Note_column::has_interface (se))
+ if (has_interface<Note_column> (se))
{
if (!Note_column::dir (se))
se->programming_error ("note-column has no direction");
/* properties */
"merge-differently-dotted "
"merge-differently-headed "
+ "note-collision-threshold "
"positioning-done "
"prefer-dotted-right "
);