OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2009--2010 Joe Neeman <joeneeman@gmail.com> | 4 Copyright (C) 2009--2010 Joe Neeman <joeneeman@gmail.com> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 { | 302 { |
303 Simple_spacer spacer; | 303 Simple_spacer spacer; |
304 | 304 |
305 for (vsize i = 0; i < springs_.size (); ++i) | 305 for (vsize i = 0; i < springs_.size (); ++i) |
306 spacer.add_spring (springs_[i]); | 306 spacer.add_spring (springs_[i]); |
307 | 307 |
308 spacer.solve (page_height_, ragged); | 308 spacer.solve (page_height_, ragged); |
309 solution_ = spacer.spring_positions (); | 309 solution_ = spacer.spring_positions (); |
310 | 310 |
311 if (!spacer.fits ()) | 311 if (!spacer.fits ()) |
312 warning (_f ("couldn't fit music on page: overflow is %f", | 312 { |
313 » » spacer.configuration_length(spacer.force()) - page_height_)); | 313 Real overflow = spacer.configuration_length (spacer.force ()) - page_heigh
t_; |
| 314 vsize space_count = solution_.size (); |
| 315 for (vsize i = 0; i < space_count; i++) |
| 316 » solution_[i] -= (i + 1) * overflow / space_count; |
| 317 warning (_f ("couldn't fit music on page: overflow is %f", |
| 318 » » overflow)); |
| 319 warning (_ ("compressing music to fit")); |
| 320 } |
314 } | 321 } |
315 | 322 |
316 // The solution_ vector stores the position of every live VerticalAxisGroup | 323 // The solution_ vector stores the position of every live VerticalAxisGroup |
317 // and every title. From that information, | 324 // and every title. From that information, |
318 // 1) within each system, stretch the staves so they land at the right position | 325 // 1) within each system, stretch the staves so they land at the right position |
319 // 2) find the offset of each system (relative to the printable area of the page
). | 326 // 2) find the offset of each system (relative to the printable area of the page
). |
320 // TODO: this function is getting too long, maybe split it up? | 327 // TODO: this function is getting too long, maybe split it up? |
321 SCM | 328 SCM |
322 Page_layout_problem::find_system_offsets () | 329 Page_layout_problem::find_system_offsets () |
323 { | 330 { |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 { | 771 { |
765 if (Hara_kiri_group_spanner::has_interface (input[i])) | 772 if (Hara_kiri_group_spanner::has_interface (input[i])) |
766 Hara_kiri_group_spanner::consider_suicide (input[i]); | 773 Hara_kiri_group_spanner::consider_suicide (input[i]); |
767 | 774 |
768 if (input[i]->is_live ()) | 775 if (input[i]->is_live ()) |
769 output.push_back (input[i]); | 776 output.push_back (input[i]); |
770 } | 777 } |
771 | 778 |
772 return output; | 779 return output; |
773 } | 780 } |
OLD | NEW |