- Pointer_group_interface::add_grob (me, ly_symbol2scm ("bars"), b);
- Side_position_interface::add_support (me,b);
- add_bound_item (dynamic_cast<Spanner*> (me), b);
+ Spanner *orig_span = dynamic_cast<Spanner *> (me->original ());
+
+ bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner *)me);
+ bool broken_last_bracket = orig_span && (orig_span->broken_intos_.back () == (Spanner *)me);
+ bool no_vertical_start = orig_span && !broken_first_bracket;
+ bool no_vertical_end = orig_span && !broken_last_bracket;
+
+ extract_grob_set (me, "bars", bars);
+ Grob *endbar = bars.size () ? bars.back () : 0;
+ SCM glyph = endbar ? endbar->get_property ("glyph-name") : SCM_EOL;
+
+ string str;
+ if (scm_is_string (glyph))
+ str = ly_scm2string (glyph);
+ else
+ str = "|";
+
+ no_vertical_end
+ |= (str != ":|"
+ && str != "|:"
+ && str != "|."
+ && str != ":|:"
+ && str != ":|.|:"
+ && str != ":|.:"
+ && str != ".|");
+
+ if (no_vertical_end || no_vertical_start)
+ {
+ Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
+ Interval (1.0, 1.0));
+ if (no_vertical_start)
+ edge_height[LEFT] = 0.0;
+
+ if (no_vertical_end)
+ edge_height[RIGHT] = 0.0;
+
+ me->set_property ("edge-height", ly_interval2scm (edge_height));
+ }
+
+ if (broken_last_bracket && no_vertical_end && no_vertical_start
+ && !broken_first_bracket)
+ me->suicide ();