#include <map>
+using std::map;
+using std::string;
+using std::vector;
+
Beam_stem_segment::Beam_stem_segment ()
{
max_connect_ = 1000; // infinity
Real beam_thickness = get_beam_thickness (me);
Real fract = robust_scm2double (me->get_property ("length-fraction"), 1.0);
- Real beam_translation = beam_count < 4
- ? (2 * staff_space + line - beam_thickness) / 2.0
- : (3 * staff_space + line - beam_thickness) / 3.0;
-
- return fract * beam_translation;
+ /*
+ if fract != 1.0, as is the case for grace notes, we want the gap
+ to decrease too. To achieve this, we divide the thickness by
+ fract */
+ return (beam_count < 4
+ ? (2 * staff_space * fract + line * fract - beam_thickness) / 2.0
+ : (3 * staff_space * fract + line * fract - beam_thickness) / 3.0);
}
/* Maximum beam_count. */
return scm_from_double (0.0);
Grob *beam = unsmob<Grob> (stem->get_object ("beam"));
if (!beam
- || !Beam::has_interface (beam)
+ || !has_interface<Beam> (beam)
|| !Beam::normal_stem_count (beam))
return scm_from_double (0.0);