From: Han-Wen Nienhuys Date: Mon, 1 Jan 2007 13:36:33 +0000 (+0100) Subject: even more robust attachment of loose columns. X-Git-Tag: release/2.11.7-1~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1312585e11f03819dd64322463d486e49693494b;p=lilypond.git even more robust attachment of loose columns. --- diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index 7d46f78e1c..6a27eb158b 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -14,23 +14,15 @@ #include "std-vector.hh" #include "grob-interface.hh" -/* - TODO: prune to public interface. -*/ class Spacing_spanner - { -public: +private: static void set_distances_for_loose_col (Grob *me, Grob *c, Drul_array next_door, Spacing_options const *); static void generate_pair_spacing (Grob *me, Paper_column *l, Paper_column *r, Paper_column *nextr, Spacing_options const *options); - static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r, - Real *fixed, Real *space, - Spacing_options const *); static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment); - static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *); static Real get_duration_space (Moment dur, Spacing_options const *, bool *); static Rational effective_shortest_duration (Grob *me, vector const &all); static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *); @@ -40,7 +32,13 @@ public: static void generate_springs (Grob *me, vector const &cols, Spacing_options const *); static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *); static vector get_columns (Spanner *me); - + +public: + static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *); + static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r, + Real *fixed, Real *space, + Spacing_options const *); + DECLARE_SCHEME_CALLBACK (set_springs, (SCM)); DECLARE_SCHEME_CALLBACK (calc_common_shortest_duration, (SCM)); DECLARE_GROB_INTERFACE(); diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index 069ff0e231..4102ecdecc 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -77,9 +77,23 @@ set_loose_columns (System *which, Column_x_positions const *posns) else { clique.back ()->programming_error ("Loose column does not have right side to attach to."); - right = which->get_bound (RIGHT); + System *base_system = dynamic_cast (which->original ()); + int j = Paper_column::get_rank (clique.back ()) + 1; + int end_rank = Paper_column::get_rank (which->get_bound (RIGHT)); + extract_grob_set (base_system, "columns", base_cols); + for (; j < end_rank; j++) + { + if (base_cols[j]->get_system () == which) + right = dynamic_cast ((Grob*)base_cols[j]); + } } + + if (!right) + { + programming_error ("Can't attach loose column sensibly. Attaching to end of system."); + right = which->get_bound (RIGHT); + } Grob *common = right->common_refpoint (left, X_AXIS); clique.push_back (right);