X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fspacing-loose-columns.cc;h=9caba57552f9dde6a2469993c2d83314ad0ad56e;hb=64313890b232c731d432e5b096f30bffc3f3756d;hp=9eda23b1a1dff2379b0deadd41cd094fd01bb0e5;hpb=1b6937d111e6bddf65d00fd63a99f0d83cb41836;p=lilypond.git diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index 9eda23b1a1..9caba57552 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -3,10 +3,9 @@ source file of the GNU LilyPond music typesetter - (c) 2005 Han-Wen Nienhuys + (c) 2005--2006 Han-Wen Nienhuys */ - #include "system.hh" #include "paper-column.hh" #include "column-x-positions.hh" @@ -24,7 +23,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) { int loose_col_count = posns->loose_cols_.size (); if (!loose_col_count) - return; + return; Real default_padding = 1.0; for (int i = 0; i < loose_col_count; i++) @@ -58,10 +57,10 @@ set_loose_columns (System *which, Column_x_positions const *posns) if (!left->get_system ()) left = left->find_prebroken_piece (RIGHT); - clique.push (left); + clique.push_back (left); } - - clique.push (loose); + + clique.push_back (loose); divide_over++; loose = right = re->get_column (); @@ -70,28 +69,26 @@ set_loose_columns (System *which, Column_x_positions const *posns) if (!right->get_system ()) right = right->find_prebroken_piece (LEFT); - clique.push (right); + clique.push_back (right); Grob *common = right->common_refpoint (left, X_AXIS); - Item *finished_right_column = clique.top(); - - for (int j = clique.size() - 2; j > 0; j--) + Item *finished_right_column = clique.back (); + + for (vsize j = clique.size () - 2; j > 0; j--) { int count = 0; Real total_space = 0.0; Real total_fixed = 0.0; extract_grob_set (col, "spacing-wishes", wishes); - for (int i = 0; i < wishes.size (); i++) + for (vsize i = 0; i < wishes.size (); i++) { Grob *spacing = wishes[i]; Real space = 0.0; Real fixed = 0.0; if (Staff_spacing::has_interface (spacing)) - { - Staff_spacing::get_spacing_params (spacing, &space, &fixed); - } + Staff_spacing::get_spacing_params (spacing, &space, &fixed); else if (Note_spacing::has_interface (spacing)) { Spacing_options options; @@ -106,10 +103,8 @@ set_loose_columns (System *which, Column_x_positions const *posns) &space, &fixed); } else - { - continue; - } - + continue; + count++; total_space += space; @@ -117,7 +112,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) } Real distance_to_next = 0.0; - Real right_point = 0.0; + Real right_point = 0.0; if (count) { total_space /= count; @@ -129,13 +124,13 @@ set_loose_columns (System *which, Column_x_positions const *posns) } else { - Interval my_extent = col->extent (col, X_AXIS); + Interval my_extent = robust_relative_extent (col, col, X_AXIS); distance_to_next = my_extent[RIGHT] + default_padding; - right_point = finished_right_column->extent (common, X_AXIS)[LEFT]; + right_point = robust_relative_extent (finished_right_column, common, X_AXIS)[LEFT]; } Real my_offset = right_point - distance_to_next; - + col->system_ = which; col->translate_axis (my_offset - col->relative_coordinate (common, X_AXIS), X_AXIS); @@ -144,4 +139,3 @@ set_loose_columns (System *which, Column_x_positions const *posns) } } -