+ do
+ {
+ Item *b = bounds[d];
+ x_points[d] = b->relative_coordinate (common, X_AXIS);
+ if (broken [d])
+ {
+ if (d == LEFT)
+ x_points[d] = b->extent (common, X_AXIS)[RIGHT];
+ }
+ else
+ {
+ if (Text_interface::has_interface (b))
+ {
+ Interval e = b->extent (common, X_AXIS);
+ if (!e.is_empty ())
+ x_points[d] = e[-d] - d * padding;
+ }
+ else
+ {
+ bool neighbor_found = false;
+ extract_grob_set (me, "adjacent-hairpins", pins);
+ for (int i = 0; i < pins.size (); i++)
+ {
+ /*
+ FIXME: this will fuck up in case of polyphonic
+ notes in other voices. Need to look at note-columns
+ in the current staff/voice.
+ */
+
+ Spanner *pin = dynamic_cast<Spanner *> (pins[i]);
+ if (pin
+ && (pin->get_bound (LEFT)->get_column () == b->get_column ()
+ || pin->get_bound (RIGHT)->get_column () == b->get_column ()))
+ neighbor_found = true;
+ }
+
+ /*
+ If we're hung on a paper column, that means we're not
+ adjacent to a text-dynamic, and we may move closer. We
+ make the padding a little smaller, here.
+ */
+ Interval e = robust_relative_extent (b, common, X_AXIS);
+ x_points[d]
+ = neighbor_found ? e.center () - d * padding / 3 : e[d];
+ }