LEFT | RIGHT |
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--2012 Joe Neeman <joeneeman@gmail.com> | 4 Copyright (C) 2009--2012 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 */ | 576 */ |
577 Real minimum_distance = up_skyline.distance (bottom_skyline_, | 577 Real minimum_distance = up_skyline.distance (bottom_skyline_, |
578 robust_scm2double (sys->get_prope
rty ("skyline-horizontal-padding"), | 578 robust_scm2double (sys->get_prope
rty ("skyline-horizontal-padding"), |
579 0)) | 579 0)) |
580 + padding; | 580 + padding; |
581 | 581 |
582 Spring spring_copy = spring; | 582 Spring spring_copy = spring; |
583 spring_copy.ensure_min_distance (minimum_distance); | 583 spring_copy.ensure_min_distance (minimum_distance); |
584 springs_.push_back (spring_copy); | 584 springs_.push_back (spring_copy); |
585 | 585 |
| 586 if (elts.size () && !is_spaceable (elts[0])) |
| 587 { |
| 588 // store the minimum distance, considering relative indents, |
| 589 // for a loose line |
| 590 Skyline first_skyline (UP); |
| 591 Skyline_pair *sky = Skyline_pair::unsmob (elts[0]->get_property ("vertical
-skylines")); |
| 592 if (sky) |
| 593 first_skyline.merge ((*sky)[UP]); |
| 594 first_skyline.shift (indent); |
| 595 minimum_distance = first_skyline.distance (bottom_skyline_) - bottom_loose
_baseline_; |
| 596 } |
586 bottom_skyline_ = down_skyline; | 597 bottom_skyline_ = down_skyline; |
587 elements_.push_back (Element (elts, minimum_offsets, padding)); | 598 elements_.push_back (Element (elts, minimum_offsets, minimum_distance, padding
)); |
588 | 599 |
589 // Add the springs for the VerticalAxisGroups in this system. | 600 // Add the springs for the VerticalAxisGroups in this system. |
590 | 601 |
591 // If the user has specified the offsets of the individual staves, fix the | 602 // If the user has specified the offsets of the individual staves, fix the |
592 // springs at the given distances. Otherwise, use stretchable springs. | 603 // springs at the given distances. Otherwise, use stretchable springs. |
593 SCM details = get_details (elements_.back ()); | 604 SCM details = get_details (elements_.back ()); |
594 SCM manual_dists = ly_assoc_get (ly_symbol2scm ("alignment-distances"), detail
s, SCM_EOL); | 605 SCM manual_dists = ly_assoc_get (ly_symbol2scm ("alignment-distances"), detail
s, SCM_EOL); |
595 vsize last_spaceable_staff = 0; | 606 vsize last_spaceable_staff = 0; |
596 bool found_spaceable_staff = false; | 607 bool found_spaceable_staff = false; |
597 for (vsize i = 0; i < elts.size (); ++i) | 608 for (vsize i = 0; i < elts.size (); ++i) |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 distribute_loose_lines (loose_lines, loose_line_min_distan
ces, | 844 distribute_loose_lines (loose_lines, loose_line_min_distan
ces, |
834 last_spaceable_line_translation, -
solution_[spring_idx]); | 845 last_spaceable_line_translation, -
solution_[spring_idx]); |
835 loose_lines.clear (); | 846 loose_lines.clear (); |
836 loose_line_min_distances.clear (); | 847 loose_line_min_distances.clear (); |
837 } | 848 } |
838 last_spaceable_line = staff; | 849 last_spaceable_line = staff; |
839 last_spaceable_line_translation = -solution_[spring_idx]; | 850 last_spaceable_line_translation = -solution_[spring_idx]; |
840 found_spaceable_staff = true; | 851 found_spaceable_staff = true; |
841 spring_idx++; | 852 spring_idx++; |
842 } | 853 } |
843 else | 854 else // ! is_spaceable |
844 { | 855 { |
845 if (loose_lines.empty ()) | 856 if (loose_lines.empty ()) |
846 loose_lines.push_back (last_spaceable_line); | 857 loose_lines.push_back (last_spaceable_line); |
847 | 858 |
848 if (staff_idx) | 859 if (staff_idx) |
849 // NOTE: the way we do distances between loose lines (and ot
her lines too, actually) | 860 // NOTE: the way we do distances between loose lines (and ot
her lines too, actually) |
850 // is not the most accurate way possible: we only insert rod
s between adjacent | 861 // is not the most accurate way possible: we only insert rod
s between adjacent |
851 // lines. To be more accurate, we could insert rods between
non-adjacent lines | 862 // lines. To be more accurate, we could insert rods between
non-adjacent lines |
852 // using a scheme similar to the one in set_column_rods. | 863 // using a scheme similar to the one in set_column_rods. |
853 loose_line_min_distances.push_back (min_offsets[staff_idx -
1] - min_offsets[staff_idx]); | 864 loose_line_min_distances.push_back (min_offsets[staff_idx -
1] - min_offsets[staff_idx]); |
854 else | 865 else |
855 { | 866 { |
856 // this is the first line in a system | 867 // this is the first line in a system |
857 Real min_dist = 0; | 868 Real min_dist = 0; |
858 if (loose_lines.back ()) | 869 if (loose_lines.back ()) |
859 { | 870 { |
860 // distance to the final line in the preceding system, | 871 // distance to the final line in the preceding system, |
861 // including 'system-system-spacing 'padding | 872 // including 'system-system-spacing 'padding |
862 min_dist = (Axis_group_interface::minimum_distance (lo
ose_lines.back (), | 873 min_dist = elements_[i].min_distance + elements_[i].pa
dding; |
863 st
aff, Y_AXIS) | |
864 + elements_[i].padding); | |
865 // A null line to break any staff-affinity for the pre
vious system | 874 // A null line to break any staff-affinity for the pre
vious system |
866 loose_line_min_distances.push_back (0.0); | 875 loose_line_min_distances.push_back (0.0); |
867 loose_lines.push_back (0); | 876 loose_lines.push_back (0); |
868 } | 877 } |
869 else if (!last_title_extent.is_empty ()) | 878 else if (!last_title_extent.is_empty ()) |
870 // distance to the preceding title, | 879 // distance to the preceding title, |
871 // including 'markup-system-spacing 'padding | 880 // including 'markup-system-wg 'padding |
872 min_dist = (staff->extent (staff, Y_AXIS)[UP] - last_tit
le_extent[DOWN] | 881 min_dist = (staff->extent (staff, Y_AXIS)[UP] - last_tit
le_extent[DOWN] |
873 + elements_[i].padding); | 882 + elements_[i].padding); |
874 else // distance to the top margin | 883 else // distance to the top margin |
875 min_dist = header_padding_ + header_height_ + staff->ext
ent (staff, Y_AXIS)[UP]; | 884 min_dist = header_padding_ + header_height_ + staff->ext
ent (staff, Y_AXIS)[UP]; |
876 | 885 |
877 loose_line_min_distances.push_back (min_dist); | 886 loose_line_min_distances.push_back (min_dist); |
878 } | 887 } |
879 loose_lines.push_back (staff); | 888 loose_lines.push_back (staff); |
880 } | 889 } |
881 } | 890 } |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 { | 1234 { |
1226 if (Hara_kiri_group_spanner::has_interface (input[i])) | 1235 if (Hara_kiri_group_spanner::has_interface (input[i])) |
1227 Hara_kiri_group_spanner::consider_suicide (input[i]); | 1236 Hara_kiri_group_spanner::consider_suicide (input[i]); |
1228 | 1237 |
1229 if (input[i]->is_live ()) | 1238 if (input[i]->is_live ()) |
1230 output.push_back (input[i]); | 1239 output.push_back (input[i]); |
1231 } | 1240 } |
1232 | 1241 |
1233 return output; | 1242 return output; |
1234 } | 1243 } |
LEFT | RIGHT |