- int b = scm_to_int (scm_car (s));
- if (scm_c_memq (scm_car (s), left) == SCM_BOOL_F)
- rfliebertjes.push_back (b);
- }
-
- Drul_array<Real> break_overshoot
- = robust_scm2drul (me->get_property ("break-overshoot"),
- Drul_array<Real> (-0.5, 0.0));
-
- Real w = (i > 0 && stem)
- ? (xposn - last_xposn)
- : break_overshoot[ (i == 0) ? LEFT : RIGHT];
-
- Real stem_offset = 0.0;
- if (i > 0)
- {
- w += last_stem_width / 2;
- stem_offset = -last_stem_width / 2;
- }
-
- if (stem)
- w += stem_width / 2;
-
- Real blot = me->layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
- Stencil whole = Lookup::beam (slope, w, thick, blot);
- Stencil gapped;
-
- int gap_count = 0;
- if (scm_is_number (me->get_property ("gap-count")))
- {
- gap_count = scm_to_int (me->get_property ("gap-count"));
- gapped = Lookup::beam (slope, w - 2 * gap_length, thick, blot);
-
- full_beams.sort (default_compare);
- if (stem_dir == UP)
- full_beams.reverse ();
- }
-
- int k = 0;
- for (vsize j = full_beams.size (); j--;)
- {
- Stencil b (whole);
-
- if (k++ < gap_count)
- {
- b = gapped;
- b.translate_axis (gap_length, X_AXIS);
- }
- b.translate_axis (last_xposn - x0 + stem_offset, X_AXIS);
- b.translate_axis (slope * (last_xposn - x0) + bdy * full_beams[j], Y_AXIS);
-
- the_beam.add_stencil (b);
- }
-
- if (lfliebertjes.size () || rfliebertjes.size ())
- {
- Real nw_f;
-
- if (stem)
- {
- int t = Stem::duration_log (stem);
- // ugh. hardcoded.
- if (t == 1)
- nw_f = 1.98;
- else
- nw_f = 1.32;
- }
- else
- nw_f = break_overshoot[RIGHT] / 2;
-
- /* Half beam should be one note-width,
- but let's make sure two half-beams never touch */
- Real lw = nw_f;
- Real rw = nw_f;
- if (i > 0)
- rw = min (nw_f, ((xposn - last_xposn) / 2));
- else
- {
- if (me->get_bound (LEFT)->break_status_dir ())
- rw = xposn - me->get_bound (LEFT)->extent (xcommon, X_AXIS)[RIGHT]
- + break_overshoot[LEFT];
- else
- rw = 1.0; // ugh.
- }
-
- if (stem)
- lw = min (nw_f, ((xposn - last_xposn) / 2));
- else
- {
- lw = me->get_bound (RIGHT)->relative_coordinate (xcommon, X_AXIS)
- - last_xposn
- + break_overshoot[RIGHT];
- }
- rw += stem_width / 2;
- lw += last_stem_width / 2;
-
- Stencil rhalf = Lookup::beam (slope, rw, thick, blot);
- Stencil lhalf = Lookup::beam (slope, lw, thick, blot);
- for (vsize j = lfliebertjes.size (); j--;)
- {
- Stencil b (lhalf);
- b.translate_axis (last_xposn - x0 - last_stem_width /2,
- X_AXIS);
- b.translate_axis (slope * (last_xposn - x0)
- + bdy * lfliebertjes[j],
- Y_AXIS);
- the_beam.add_stencil (b);
- }
- for (vsize j = rfliebertjes.size (); j--;)
- {
- Stencil b (rhalf);
- b.translate_axis (xposn - x0 - rw + stem_width / 2, X_AXIS);
- b.translate_axis (slope * (xposn - x0 - rw)
- + bdy * rfliebertjes[j], Y_AXIS);
- the_beam.add_stencil (b);
- }