source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include <math.h>
+#include "warn.hh"
#include "dimension-cache.hh"
#include "lily-guile.hh"
#include "break-align-item.hh"
symbol_list = gh_cdr (scm_reverse (symbol_list));
for (int i=0; i <elems.size()-1; i++)
{
- String sym_str = ly_scm2string (gh_car (symbol_list));
+ String sym_str = ly_symbol2string (gh_car (symbol_list));
elems[i]->set_elt_property (sym_str,
scm_cons (gh_double2scm (0),
gh_double2scm (dists[i+1])));
// urg
SCM first_pair = elems[0]->get_elt_property ("minimum-space");
- if (first_pair == SCM_UNDEFINED)
- first_pair = gh_cons (gh_double2scm (0.0), gh_double2scm (0.0));
- else
+ 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_elt_property ("minimum-space", first_pair);
Axis_align_item::do_pre_processing();
- Real pre_space = elems[0]->extent (X_AXIS)[LEFT]
- + elems[0]->relative_coordinate (column_l (), X_AXIS);
- Real spring_len = elems.top ()->extent (X_AXIS)[RIGHT]
- + elems.top ()->relative_coordinate (column_l (), X_AXIS);
+ Real pre_space = elems[0]->relative_coordinate (column_l (), X_AXIS);
+
+ Real xl = elems[0]->extent (X_AXIS)[LEFT];
+ if (!isinf (xl))
+ pre_space += xl;
+ else
+ programming_error ("Infinity reached. ");
+
+ Real xr = elems.top ()->extent (X_AXIS)[RIGHT];
+ Real spring_len = elems.top ()->relative_coordinate (column_l (), X_AXIS);
+ if (!isinf (xr))
+ spring_len += xr;
+ else
+ programming_error ("Infinity reached.");
Real stretch_distance =0.;