else
{
ret.push_back (orig[i]);
- ret.back ().force_ = 0;
}
}
return ret;
// This means that we won't cache properly if page_num is negative or
// if calc_height returns a negative number. But that's likely to
// be rare, so it shouldn't affect performance.
- vector<Real>& cache = last ? last_page_height_cache_ : page_height_cache_;
+ vector<Real> &cache = last ? last_page_height_cache_ : page_height_cache_;
if (page_num >= 0 && (int) cache.size () > page_num && cache[page_num] >= 0)
return cache[page_num];
else
else
config = layout.solution (rag);
- last_page_force = layout.force ();
+ if ((ragged () && layout.force () < 0.0)
+ || isinf (layout.force ()))
+ warning (_f ("page %d has been compressed", page_num));
+ else
+ last_page_force = layout.force ();
systems_configs_fncounts = scm_cons (scm_cons (lines, config), systems_configs_fncounts);
footnote_count += fn_lines;
cur_page_height -= min_whitespace_at_top_of_page (cached_line_details_[page_starter]);
cur_page_height -= min_whitespace_at_bottom_of_page (cached_line_details_.back ());
- Real cur_height = cur_rod_height + ((ragged_last () || ragged ()) ? cur_spring_height : 0);
if (!too_few_lines (line_count - cached_line_details_.back ().compressed_nontitle_lines_count_)
- && cur_height > cur_page_height
+ && cur_rod_height > cur_page_height
/* don't increase the page count if the last page had only one system */
&& cur_rod_height > cached_line_details_.back ().full_height ())
ret++;
SCM penalty_sym;
if (is_last ())
- penalty_sym = ly_symbol2scm ("blank-last-page-force");
+ penalty_sym = ly_symbol2scm ("blank-last-page-penalty");
else if (ends_score ())
- penalty_sym = ly_symbol2scm ("blank-after-score-page-force");
+ penalty_sym = ly_symbol2scm ("blank-after-score-page-penalty");
else
- penalty_sym = ly_symbol2scm ("blank-page-force");
+ penalty_sym = ly_symbol2scm ("blank-page-penalty");
Break_position const &pos = breaks_[current_end_breakpoint_];
if (Paper_score *ps = system_specs_[pos.system_spec_index_].pscore_)
line_penalty += uncompressed_line_details_[i].break_penalty_;
}
- for (vsize i = 0; i < res.force_.size (); i++)
+ for (vsize i = ragged () ? res.force_.size () - 1 : 0;
+ i < res.force_.size () - ragged_last ();
+ i++)
{
Real f = res.force_[i];
page1_penalty[i] = line_count_penalty (page1_line_count);
page1_status[i] = line_count_status (page1_line_count);
- if (ragged2)
+ if (ragged1)
page2_force[page2_force.size () - 1 - i]
= (page2.force_ < 0 && i + 1 < page1_force.size ()) ? infinity_f : 0;
+ else if (ragged2 && page2.force_ > 0)
+ page2_force[page2_force.size () - 1 - i] = 0.0;
else
page2_force[page2_force.size () - 1 - i] = page2.force_;
page2_penalty[page2_penalty.size () - 1 - i] = line_count_penalty (page2_line_count);