return best_start;
}
-MAKE_SCHEME_CALLBACK(Beam, calc_beaming, 1)
+MAKE_SCHEME_CALLBACK (Beam, calc_beaming, 1)
SCM
Beam::calc_beaming (SCM smob)
{
do
{
bool on_bound = (event_dir == LEFT) ? j == 0 :
- j == segs.size() - 1;
+ j == segs.size () - 1;
bool inside_stem = (event_dir == LEFT)
? segs[j].stem_index_ > 0
&& me->get_bound (event_dir)->break_status_dir ())
{
current.horizontal_[event_dir]
- = (me->get_bound (event_dir)->extent (commonx, X_AXIS)[RIGHT]
+ = (robust_relative_extent (me->get_bound (event_dir), commonx, X_AXIS)[RIGHT]
+ event_dir * break_overshoot[event_dir]);
}
else
{
current.horizontal_[event_dir] += event_dir * segs[j].width_/2;
if (segs[j].gapped_)
- current.horizontal_[event_dir] -= event_dir * gap_length;
+ {
+ current.horizontal_[event_dir] -= event_dir * gap_length;
+
+ if (Stem::is_invisible (segs[j].stem_))
+ {
+ /*
+ Need to do this in case of whole notes. We don't want the
+ heads to collide with the beams.
+ */
+ extract_grob_set (segs[j].stem_, "note-heads", heads);
+
+ for (vsize k = 0; k < heads.size (); k ++)
+ current.horizontal_[event_dir]
+ = event_dir * min (event_dir * current.horizontal_[event_dir],
+ - gap_length/2
+ + event_dir * heads[k]->extent (commonx, X_AXIS)[-event_dir]);
+ }
+ }
}
if (event_dir == RIGHT)
{
segments.push_back (current);
- current = Beam_segment();
+ current = Beam_segment ();
}
}
while (flip (&event_dir) != LEFT);
return segments;
}
-MAKE_SCHEME_CALLBACK(Beam, print, 1);
+MAKE_SCHEME_CALLBACK (Beam, print, 1);
SCM
Beam::print (SCM grob)
{
-MAKE_SCHEME_CALLBACK(Beam, calc_stem_shorten, 1)
+MAKE_SCHEME_CALLBACK (Beam, calc_stem_shorten, 1)
SCM
Beam::calc_stem_shorten (SCM smob)
{
Hmm. At this time, beam position and slope are determined. Maybe,
stem directions and length should set to relative to the chord's
position of the beam. */
-MAKE_SCHEME_CALLBACK(Beam, set_stem_lengths, 1);
+MAKE_SCHEME_CALLBACK (Beam, set_stem_lengths, 1);
SCM
Beam::set_stem_lengths (SCM smob)
{
return false;
}
-MAKE_SCHEME_CALLBACK (Beam, cross_staff, 1)
+MAKE_SCHEME_CALLBACK (Beam, calc_cross_staff, 1)
SCM
-Beam::cross_staff (SCM smob)
+Beam::calc_cross_staff (SCM smob)
{
return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
}