X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fspacing-interface.cc;h=371d5ac5de618e6b373321a35dcf5a41f8b1ea1c;hb=76c1654d8e6daceabb68d530729f87194fa49fed;hp=1cf1a02cdc941a30a54e2c0e7cfab31aac668484;hpb=157d98c1870868bf59c1691577444e3c3d533bc4;p=lilypond.git diff --git a/lily/spacing-interface.cc b/lily/spacing-interface.cc index 1cf1a02cdc..371d5ac5de 100644 --- a/lily/spacing-interface.cc +++ b/lily/spacing-interface.cc @@ -1,10 +1,20 @@ /* - spacing-interface.cc -- functionality that is shared between Note_spacing - and Staff_spacing + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2007--2010 Joe Neeman - (c) 2007 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "spacing-interface.hh" @@ -17,6 +27,7 @@ #include "paper-column.hh" #include "separation-item.hh" #include "skyline.hh" +#include "skyline-pair.hh" #include "system.hh" /* return the right-pointing skyline of the left-items and the left-pointing @@ -91,11 +102,7 @@ Spacing_interface::minimum_distance (Grob *me, Grob *right) } /* - Compute the column of the right-items. This is a big function, - since RIGHT-ITEMS may span more columns (eg. if a clef is inserted, - this will add a new column to RIGHT-ITEMS. Here we look at the - columns, and return the left-most. If there are multiple columns, we - prune RIGHT-ITEMS. + Compute the left-most column of the right-items. */ Item * Spacing_interface::right_column (Grob *me) @@ -106,7 +113,6 @@ Spacing_interface::right_column (Grob *me) Grob_array *a = unsmob_grob_array (me->get_object ("right-items")); Item *mincol = 0; int min_rank = INT_MAX; - bool prune = false; for (vsize i = 0; a && i < a->size (); i++) { Item *ri = a->item (i); @@ -117,23 +123,10 @@ Spacing_interface::right_column (Grob *me) if (rank < min_rank) { min_rank = rank; - if (mincol) - prune = true; - mincol = col; } } - if (prune && a) - { - vector &right = a->array_reference (); - for (vsize i = right.size (); i--;) - { - if (dynamic_cast (right[i])->get_column () != mincol) - right.erase (right.begin () + i); - } - } - return mincol; } @@ -228,8 +221,10 @@ Spacing_interface::extremal_break_aligned_grob (Grob *me, ADD_INTERFACE (Spacing_interface, - "This object calculates the desired and minimum distances between two columns.", + "This object calculates the desired and minimum distances" + " between two columns.", + /* properties */ "left-items " "right-items " );