+ dists.push (spc);
+ symbol_list = gh_cons (symbol, symbol_list);
+ current_origin = next_origin;
+ }
+
+
+ // skip the first sym.
+ symbol_list = ly_cdr (scm_reverse (symbol_list));
+ for (int i=0; i <elems.size ()-1; i++)
+ {
+ elems[i]->set_grob_property (ly_car (symbol_list),
+ scm_cons (gh_double2scm (0),
+ gh_double2scm (dists[i+1])));
+
+ symbol_list = ly_cdr (symbol_list);
+ }
+
+
+ // urg
+ SCM first_pair = elems[0]->get_grob_property ("minimum-space");
+ if (gh_pair_p (first_pair))
+ first_pair = first_pair;
+ else
+ first_pair = gh_cons (gh_double2scm (0.0), gh_double2scm (0.0));
+
+ scm_set_car_x (first_pair, gh_double2scm (-dists[0]));
+ elems[0]->set_grob_property ("minimum-space", first_pair);
+
+ Direction bsd = item->break_status_dir ();
+ if (bsd == LEFT)
+ {
+ me->set_grob_property ("self-alignment-X", gh_int2scm (RIGHT));
+ }
+
+ /*
+ Force callbacks for alignment to be called
+ */
+ Align_interface::align_elements_to_extents (me, X_AXIS);
+
+ Real pre_space = elems[0]->relative_coordinate (column, X_AXIS);
+
+ Real xl = elems[0]->extent (elems[0],X_AXIS)[LEFT];
+ if (!isinf (xl))
+ pre_space += xl;
+ else
+ programming_error ("Infinity reached. ");
+
+ Real xr = elems.top ()->extent (elems.top (), X_AXIS)[RIGHT];
+ Real spring_len = elems.top ()->relative_coordinate (column, X_AXIS);
+ if (!isinf (xr))
+ spring_len += xr;
+ else
+ programming_error ("Infinity reached.");
+
+ Real stretch_distance =0.;
+
+ if (ly_car (symbol_list) == ly_symbol2scm ("extra-space"))
+ {
+ spring_len += dists.top ();
+ stretch_distance = dists.top ();
+ }
+ else if (ly_car (symbol_list) == ly_symbol2scm ("minimum-space"))
+ {
+ spring_len = spring_len >? dists.top ();
+ stretch_distance = spring_len;
+ }
+
+
+ /*
+ Hint the spacing engine how much space to put in.
+
+ The pairs are in the format of an interval (ie. CAR < CDR).
+ */
+ /*
+ UGH UGH UGH
+
+ This is a side effect, and there is no guarantee that this info is
+ computed at a "sane" moment.
+
+ (just spent some time tracking a bug that was caused by this info
+ being written halfway:
+
+ self_alignment_callback (*)
+ -> child->relative_coordinate (self)
+ -> break_alignment
+ -> child->relative_coordinate (column)
+
+ the last call incorporates the value that should've been computed
+ in (*), but--of course-- is not yet.
+
+ The result is that an offsets of align_elements_to_extents () are
+ not compensated for, and spring_len is completely off.
+
+
+ */
+ column->set_grob_property ("extra-space",
+ scm_cons (gh_double2scm (pre_space),
+ gh_double2scm (spring_len)));
+
+ column->set_grob_property ("stretch-distance",
+ gh_cons (gh_double2scm (-dists[0]),
+ gh_double2scm (stretch_distance)));