- Real ideal = (spring) ? spring->distance_ : spacer_->default_space_;
- Real hooke = (spring) ? spring->strength_ : 1.0;
-
- spacer_->add_spring (ideal, hooke);
- }
-
- for (int i=0; i < cols.size () - 1; i++)
- {
- for (SCM s = Spaceable_grob::get_minimum_distances (cols[i]);
- ly_c_pair_p (s); s = ly_cdr (s))
- {
- Grob * other = unsmob_grob (ly_caar (s));
- int oi = cols.find_index (other);
- if (oi >= 0)
+
+ for (vsize i = breaks[b]; i < end; i++)
+ {
+ for (vsize r = 0; r < cols[i].rods_.size (); r++)
+ if (cols[i].rods_[r].r_ < end)
+ spacer.add_rod (i - st, cols[i].rods_[r].r_ - st, cols[i].rods_[r].dist_);
+ for (vsize r = 0; r < cols[i].end_rods_.size (); r++)
+ if (cols[i].end_rods_[r].r_ == end)
+ spacer.add_rod (i - st, end - st, cols[i].end_rods_[r].dist_);
+ if (!cols[i].keep_inside_line_.is_empty ())
+ {
+ spacer.add_rod (i - st, end - st, cols[i].keep_inside_line_[RIGHT]);
+ spacer.add_rod (0, i - st, cols[i].keep_inside_line_[LEFT]);
+ }
+ }
+ spacer.solve ((b == 0) ? line_len - indent : line_len, ragged);
+
+ /* add a (convex) penalty for compression. We do this _only_ in get_line_forces,
+ not get_line_configuration. This is temporary, for backwards compatibility;
+ the old line/page-breaking stuff ignores page breaks when it calculates line
+ breaks, so compression penalties can result in scores (eg. wtk-fugue) blowing
+ up to too many pages. */
+ Real f = spacer.force ();
+ force[b * breaks.size () + c] = f - (f < 0 ? f*f*f*f*4 : 0);
+
+ if (!spacer.fits ())