/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2000--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 2000--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Box b;
b[a] = begin_of_line_extent;
b[other_axis (a)] = Interval (-infinity_f, -1);
- skylines.insert (b, 0, other_axis (a));
+ skylines.insert (b, other_axis (a));
}
}
Box b;
b[a] = extent;
b[other_axis (a)] = Interval (0, infinity_f);
- skylines.insert (b, 0, other_axis (a));
+ skylines.insert (b, other_axis (a));
}
}
}
// If include_fixed_spacing is false, the only constraints that will be measured
-// here are those that result from collisions (+ padding) and minimum-distance
+// here are those that result from collisions (+ padding) and the spacing spec
// between adjacent staves.
// If include_fixed_spacing is true, constraints from line-break-system-details,
// basic-distance+stretchable=0, and staff-staff-spacing of spaceable staves
if (!pure && a == Y_AXIS && dynamic_cast<Spanner *> (me) && !me->get_system ())
me->programming_error ("vertical alignment called before line-breaking");
+ // check the cache
+ if (pure)
+ {
+ SCM fv = ly_assoc_get (scm_cons (scm_from_int (start), scm_from_int (end)),
+ me->get_property ("minimum-translations-alist"),
+ SCM_EOL);
+ if (fv != SCM_EOL)
+ return ly_scm2floatvector (fv);
+ }
+
// If include_fixed_spacing is true, we look at things like system-system-spacing
// and alignment-distances, which only make sense for the toplevel VerticalAlignment.
// If we aren't toplevel, we're working on something like BassFigureAlignment
dy = down_skyline.distance (skylines[j][-stacking_dir]) + padding;
- Real min_distance = 0;
- if (Page_layout_problem::read_spacing_spec (spec, &min_distance, ly_symbol2scm ("minimum-distance")))
- dy = max (dy, min_distance);
+ Real spec_distance = 0;
+ if (Page_layout_problem::read_spacing_spec (spec, &spec_distance, ly_symbol2scm ("minimum-distance")))
+ dy = max (dy, spec_distance);
+ // Consider the likely final spacing when estimating distance between staves of the full score
+ if (INT_MAX == end && 0 == start
+ && Page_layout_problem::read_spacing_spec (spec, &spec_distance, ly_symbol2scm ("basic-distance")))
+ dy = max (dy, spec_distance);
if (include_fixed_spacing && Page_layout_problem::is_spaceable (elems[j]) && last_spaceable_element)
{
all_translates.push_back (w);
}
}
+
+ if (pure)
+ {
+ SCM mta = me->get_property ("minimum-translations-alist");
+ mta = scm_cons (scm_cons (scm_cons (scm_from_int (start), scm_from_int (end)),
+ ly_floatvector2scm (all_translates)),
+ mta);
+ me->set_property ("minimum-translations-alist", mta);
+ }
return all_translates;
}
"align-dir "
"axes "
"elements "
+ "minimum-translations-alist "
"padding "
"positioning-done "
"stacking-dir "