alter_spring_from_spacing_spec (spec, &spring);
springs_.push_back (spring);
- Real min_distance = (found_spaceable_staff ? minimum_offsets[last_spaceable_staff] : 0) - minimum_offsets[i];
+ Real min_distance = (found_spaceable_staff ? minimum_offsets_with_min_dist[last_spaceable_staff] : 0) - minimum_offsets_with_min_dist[i];
springs_.back ().ensure_min_distance (min_distance);
if (scm_is_pair (manual_dists))
Real system_position = first_staff_position + first_staff_min_translation;
// Position the staves within this system.
- Real translation = 0;
vector<Real> const& min_offsets = elements_[i].min_offsets;
bool found_spaceable_staff = false;
for (vsize staff_idx = 0; staff_idx < elements_[i].staves.size (); ++staff_idx)
if (is_spaceable (staff))
{
// this is relative to the system: negative numbers are down.
- translation = system_position - solution_[spring_idx];
- spring_idx++;
+ staff->translate_axis (system_position - solution_[spring_idx], Y_AXIS);
// Lay out any non-spaceable lines between this line and
// the last one.
loose_lines.push_back (staff);
distribute_loose_lines (loose_lines, loose_line_min_distances,
- last_spaceable_line_translation, translation - system_position);
+ last_spaceable_line_translation, -solution_[spring_idx]);
loose_lines.clear ();
loose_line_min_distances.clear ();
}
last_spaceable_line = staff;
- // Negative is down but the translation is relative to the whole page.
- last_spaceable_line_translation = -system_position + translation;
-
- staff->translate_axis (translation, Y_AXIS);
+ last_spaceable_line_translation = -solution_[spring_idx];
found_spaceable_staff = true;
+ spring_idx++;
}
else
{
loose_lines.push_back (last_spaceable_line);
if (staff_idx)
+ // NOTE: the way we do distances between loose lines (and other lines too, actually)
+ // is not the most accurate way possible: we only insert rods between adjacent
+ // lines. To be more accurate, we could insert rods between non-adjacent lines
+ // using a scheme similar to the one in set_column_rods.
loose_line_min_distances.push_back (min_offsets[staff_idx-1] - min_offsets[staff_idx]);
else
{ // this is the first line in a system