X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fnote-spacing.cc;h=2cc5c70ae2369c38b47a87309ebf1ca715ca8218;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=96f7b8f8e35078da3b53b6be2f5daa18c38d619b;hpb=1fa4c73e647c2b3ea2c0b337b58e7699eb7170a2;p=lilypond.git diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 96f7b8f8e3..2cc5c70ae2 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2001--2007 Han-Wen Nienhuys + (c) 2001--2008 Han-Wen Nienhuys */ #include "note-spacing.hh" @@ -23,6 +23,12 @@ #include "output-def.hh" #include "pointer-group-interface.hh" +static bool +non_empty_barline (Grob *me) +{ + return Bar_line::has_interface (me) && !me->extent (me, X_AXIS).is_empty (); +} + /* TODO: detect hshifts due to collisions, and account for them in spacing? @@ -80,7 +86,7 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, { Grob *bar = Pointer_group_interface::find_grob (right_col, ly_symbol2scm ("elements"), - Bar_line::has_interface); + non_empty_barline); if (bar) { @@ -95,6 +101,8 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, ideal = max (ideal, min_desired_space); stem_dir_correction (me, right_col, increment, &ideal, &min_desired_space); + /* TODO: grace notes look bad when things are stretched. Should we increase + their stretch strength? */ Spring ret (max (0.0, ideal), min_dist); ret.set_inverse_compress_strength (max (0.0, ideal - min_desired_space)); ret.set_inverse_stretch_strength (max (0.1, base_space - increment)); @@ -311,13 +319,12 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, ADD_INTERFACE (Note_spacing, "This object calculates spacing wishes for individual voices.", - + /* properties */ "knee-spacing-correction " "left-items " "right-items " "same-direction-correction " "stem-spacing-correction " "space-to-barline " - );