- Stem_tremolo * s = dynamic_cast<Stem_tremolo*> (se);
- Real space = Staff_symbol_referencer_interface (s->stem_l ())
- .staff_space ();
- return Interval (-space, space);
+ Real ss = Staff_symbol_referencer::staff_space (me);
+ Real thick = robust_scm2double (me->get_property ("beam-thickness"), 1);
+ Real width = robust_scm2double (me->get_property ("beam-width"), 1);
+ Real blot = me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"));
+ SCM style = me->get_property ("style");
+ if (!scm_is_symbol (style))
+ style = ly_symbol2scm ("default");
+
+ width *= ss;
+ thick *= ss;
+
+ Stencil a;
+ if (style == ly_symbol2scm ("rectangle"))
+ a = Lookup::rotated_box (slope, width, thick, blot);
+ else
+ a = Lookup::beam (slope, width, thick, blot);
+
+ a.align_to (X_AXIS, CENTER);
+ a.align_to (Y_AXIS, CENTER);
+
+ int tremolo_flags = robust_scm2int (me->get_property ("flag-count"), 0);
+ if (!tremolo_flags)
+ {
+ programming_error ("no tremolo flags");
+
+ me->suicide ();
+ return Stencil ();
+ }
+
+ Real beam_translation = get_beam_translation (me);
+
+ Stencil mol;
+ for (int i = 0; i < tremolo_flags; i++)
+ {
+ Stencil b (a);
+ b.translate_axis (beam_translation * i * stemdir * -1, Y_AXIS);
+ mol.add_stencil (b);
+ }
+ return mol;