return me->get_maybe_pure_property ("default-staff-staff-spacing", pure, start, end);
}
-Real
-Axis_group_interface::minimum_distance (Grob *g1, Grob *g2, Axis a)
-{
- SCM sym = ly_symbol2scm ((a == Y_AXIS) ? "vertical-skylines" : "horizontal-skylines");
-
- Skyline_pair *s1 = Skyline_pair::unsmob (g1->get_property (sym));
- Skyline_pair *s2 = Skyline_pair::unsmob (g2->get_property (sym));
- if (s1 && s2)
- return (*s1)[DOWN].distance ((*s2)[UP]);
- return 0;
-}
-
ADD_INTERFACE (Axis_group_interface,
"An object that groups other layout objects.",
Prob *prob;
vector<Grob *> staves;
vector<Real> min_offsets;
- // Store the appropriate '*-*-spacing 'padding,
- // for spacing any adjacent loose line
+ // Store the appropriate '*-*-spacing 'padding, and skyline-distance,
+ // considering indentation, from the previous system.
+ Real min_distance;
Real padding;
- Element (vector<Grob *> const &a, vector<Real> const &o, Real p)
+ Element (vector<Grob *> const &a, vector<Real> const &o, Real m, Real p)
{
staves = a;
min_offsets = o;
+ min_distance = m;
padding = p;
prob = 0;
}
spring_copy.ensure_min_distance (minimum_distance);
springs_.push_back (spring_copy);
+ if (elts.size () && !is_spaceable (elts[0]))
+ {
+ // store the minimum distance, considering relative indents,
+ // for a loose line
+ Skyline first_skyline (UP);
+ Skyline_pair *sky = Skyline_pair::unsmob (elts[0]->get_property ("vertical-skylines"));
+ if (sky)
+ first_skyline.merge ((*sky)[UP]);
+ first_skyline.shift (indent);
+ minimum_distance = first_skyline.distance (bottom_skyline_) - bottom_loose_baseline_ ;
+ }
bottom_skyline_ = down_skyline;
- elements_.push_back (Element (elts, minimum_offsets, padding));
+ elements_.push_back (Element (elts, minimum_offsets, minimum_distance, padding));
// Add the springs for the VerticalAxisGroups in this system.
found_spaceable_staff = true;
spring_idx++;
}
- else
+ else // ! is_spaceable
{
if (loose_lines.empty ())
loose_lines.push_back (last_spaceable_line);
{
// distance to the final line in the preceding system,
// including 'system-system-spacing 'padding
- min_dist = (Axis_group_interface::minimum_distance (loose_lines.back (),
- staff, Y_AXIS)
- + elements_[i].padding);
+ min_dist = elements_[i].min_distance + elements_[i].padding;
// A null line to break any staff-affinity for the previous system
loose_line_min_distances.push_back (0.0);
loose_lines.push_back (0);
}
else if (!last_title_extent.is_empty ())
// distance to the preceding title,
- // including 'markup-system-spacing 'padding
+ // including 'markup-system-wg 'padding
min_dist = (staff->extent (staff, Y_AXIS)[UP] - last_title_extent[DOWN]
+ elements_[i].padding);
else // distance to the top margin