X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpage-spacing.cc;h=97c68a5e29ebae8d1ca48151568843940ea0d8b6;hb=a6a51abfd0195a3cf7d6ea095cf69808852f21ce;hp=32550066334e33ce22ea42cb1ebf88c805e17de8;hpb=f93e4199873c91ae32f0e84a610d14853dc379df;p=lilypond.git diff --git a/lily/page-spacing.cc b/lily/page-spacing.cc index 3255006633..97c68a5e29 100644 --- a/lily/page-spacing.cc +++ b/lily/page-spacing.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2006--2011 Joe Neeman + Copyright (C) 2006--2015 Joe Neeman LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,7 +72,18 @@ Real Page_spacing::account_for_footnotes (Line_details const &line) { Real footnote_height = 0.0; - for (vsize i = 0; i < line.footnotes_.size (); i++) + Real in_note_height = 0.0; + bool has_in_notes = false; + for (vsize i = 0; i < line.in_note_heights_.size (); i++) + { + in_note_height += (has_in_notes + ? 0.0 + : breaker_->in_note_padding ()); + has_in_notes = true; + in_note_height += line.in_note_heights_[i]; + } + + for (vsize i = 0; i < line.footnote_heights_.size (); i++) { footnote_height += (has_footnotes_ ? 0.0 @@ -81,14 +92,18 @@ Page_spacing::account_for_footnotes (Line_details const &line) + breaker_->footnote_number_raise ())); has_footnotes_ = true; - Interval extent = line.footnotes_[i]->extent (Y_AXIS); - footnote_height += extent[UP] - extent[DOWN]; + footnote_height += line.footnote_heights_[i]; footnote_height += breaker_->footnote_padding (); } - return (footnote_height - - (has_footnotes_ - ? breaker_->footnote_padding () + breaker_->footnote_footer_padding () + return (in_note_height + - (has_in_notes + ? breaker_->in_note_padding () + : 0.0)) + + + (footnote_height + + (has_footnotes_ + ? - breaker_->footnote_padding () + breaker_->footnote_footer_padding () : 0.0)); } @@ -140,6 +155,9 @@ Page_spacer::solve () } Page_spacing_result ret; + if (simple_state_.empty ()) + return ret; + ret.penalty_ = simple_state_.back ().penalty_ + lines_.back ().page_penalty_ + lines_.back ().turn_penalty_; ret.system_count_status_ = simple_state_.back ().system_count_status_; @@ -311,7 +329,7 @@ Page_spacer::calc_subproblem (vsize page, vsize line) space.prepend_system (lines_[page_start]); bool overfull = (space.rod_height_ > paper_height - || (ragged + || (ragged_ && (space.rod_height_ + space.spring_len_ > paper_height))); // This 'if' statement is a little hard to parse. It won't consider this configuration // if it is overfull unless the current configuration is the first one with this start @@ -370,7 +388,8 @@ Page_spacer::calc_subproblem (vsize page, vsize line) } if (page_start > 0 - && lines_[page_start - 1].page_permission_ == ly_symbol2scm ("force")) + && scm_is_eq (lines_[page_start - 1].page_permission_, + ly_symbol2scm ("force"))) break; } return !isinf (cur.demerits_);