return sys + 1; /* this page starts with a new System_spec */
}
-Page_breaking::Page_breaking (Paper_book *pb, Break_predicate is_break)
+Page_breaking::Page_breaking (Paper_book *pb, Break_predicate is_break, Prob_break_predicate prob_break)
{
book_ = pb;
system_count_ = 0;
}
create_system_list ();
- find_chunks_and_breaks (is_break);
+ find_chunks_and_breaks (is_break, prob_break);
}
Page_breaking::~Page_breaking ()
}
void
-Page_breaking::find_chunks_and_breaks (Break_predicate is_break)
+Page_breaking::find_chunks_and_breaks (Break_predicate is_break, Prob_break_predicate prob_is_break)
{
SCM force_sym = ly_symbol2scm ("force");
}
bool last = (j == cols.size () - 1);
- bool break_point = is_break (cols[j]);
+ bool break_point = is_break && is_break (cols[j]);
bool chunk_end = cols[j]->get_property ("page-break-permission") == force_sym;
Break_position cur_pos = Break_position (i,
line_breaker_columns.size (),
}
else
{
- /* TODO: we want some way of applying Break_p to a prob? */
- if (i == system_specs_.size () - 1)
+ bool break_point = prob_is_break && prob_is_break (system_specs_[i].prob_);
+ if (break_point || i == system_specs_.size () - 1)
breaks_.push_back (Break_position (i));
chunks_.push_back (Break_position (i));