- Span_bar::evaluate_glyph(me);
- SCM glyph = me->get_grob_property (ly_symbol2scm ("glyph"));
- String glyph_str = ly_scm2string (glyph);
- SCM first_elt = me->get_grob_property ("elements");
-
- // first walk: compute axis_group parent via common_refpoint () on all bars
- Grob *refpoint = 0;
- int staff_bar_count = 0;
- for (SCM elts = first_elt;
- elts != SCM_EOL;
- elts = gh_cdr (elts))
- {
- SCM smobbed_staff_bar = gh_car (elts);
- Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
- refpoint = (staff_bar_count > 0) ?
- staff_bar->common_refpoint (refpoint, Y_AXIS) :
- staff_bar;
- staff_bar_count++;
- }
- /* assert: refpoint is an axis-group object */
- Grob *axis_group = refpoint;
-
- // second walk: collect span bar components;
- // compute extent of axis_group
- Real last_staff_bar_length;
- Real *interstaff_bar_length = new Real[staff_bar_count];
- Real *interstaff_bar_yoffs = new Real[staff_bar_count];
- Molecule *interstaff_bar_molecule = new Molecule[staff_bar_count];
- Real axis_group_extent = 0.0;
- staff_bar_count = 0;
- for (SCM elts = first_elt;
- elts != SCM_EOL;
- elts = gh_cdr (elts))
- {
- SCM smobbed_staff_bar = gh_car (elts);
- SCM smobbed_staff_bar_molecule =
- Bar::brew_molecule (smobbed_staff_bar);
- Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
- interstaff_bar_yoffs[staff_bar_count] =
- staff_bar->relative_coordinate (axis_group, (Axis)Y_AXIS);
- if (smobbed_staff_bar_molecule != SCM_EOL)
+ extract_grob_set (me, "elements", elements);
+ Grob *refp = common_refpoint_of_array (elements, me, Y_AXIS);
+
+ SCM glyph = me->get_property ("glyph-name");
+
+ /* glyph may not be a string, when ME is killed by Hara Kiri in
+ between. */
+ if (!scm_is_string (glyph))
+ return SCM_EOL;
+
+ string glyph_string = ly_scm2string (glyph);
+
+ /* compose span_bar_mol */
+ vector<Interval> extents;
+ vector<bool> make_span_bar;
+ Grob *model_bar = 0;
+ for (vsize i = elements.size (); i--;)