From: Joe Neeman Date: Sat, 18 Aug 2007 02:15:18 +0000 (+1000) Subject: Fix 399 again. X-Git-Tag: release/2.11.30-1~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4063c4f664e044181e416857e999cb07391c3e33;p=lilypond.git Fix 399 again. Add a left-neighbor to a column even if it is not the minimum-rank column in the right-items list of a spacing object. --- diff --git a/lily/spacing-interface.cc b/lily/spacing-interface.cc index 1cf1a02cdc..65ac96834f 100644 --- a/lily/spacing-interface.cc +++ b/lily/spacing-interface.cc @@ -96,6 +96,15 @@ Spacing_interface::minimum_distance (Grob *me, Grob *right) 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. + + If we end up pruning, we add a left-neighbor to every column that + gets pruned. This ensures that loose columns in cross-staff music + do indeed get marked as loose. The problem situation is when a voice + passes from staff 1 to staff 2 and a clef appears later on in staff 1. + Then the NoteSpacing attached to the last note in staff 1 has two + right-items: one pointing to the next note in staff 2 and one pointing + to the clef. We will prune the clef right-item here and, unless we add + a left-neighbor to the clef, it won't get marked as loose. */ Item * Spacing_interface::right_column (Grob *me) @@ -122,6 +131,8 @@ Spacing_interface::right_column (Grob *me) mincol = col; } + else if (rank > min_rank) + prune = true; } if (prune && a) @@ -130,7 +141,15 @@ Spacing_interface::right_column (Grob *me) for (vsize i = right.size (); i--;) { if (dynamic_cast (right[i])->get_column () != mincol) - right.erase (right.begin () + i); + { + extract_grob_set (right[i], "left-neighbors", lns); + if (lns.empty ()) + Pointer_group_interface::add_grob (right[i], + ly_symbol2scm ("left-neighbors"), + dynamic_cast (me)->get_column ()); + + right.erase (right.begin () + i); + } } }