]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix spacing of the first bar on the system.
authorJoe Neeman <joeneeman@gmail.com>
Fri, 1 Jun 2007 04:53:59 +0000 (14:53 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sun, 17 Jun 2007 02:20:36 +0000 (12:20 +1000)
Fix spacing between barlines and accidentals.
Remove unused parameters from spacing functions.

lily/include/spacing-options.hh
lily/include/spacing-spanner.hh
lily/spacing-basic.cc
lily/spacing-determine-loose-columns.cc
lily/spacing-loose-columns.cc
lily/spacing-options.cc
lily/spacing-spanner.cc
lily/staff-spacing.cc

index 0b2d30b6640c255360ab9af752e84c52e3801ef4..c202c7d64d5f194017e77acd3b7bd6e99e47a3bd 100644 (file)
@@ -31,6 +31,6 @@ struct Spacing_options
   
   Spacing_options();
   void init_from_grob (Grob *me);
-  Real get_duration_space (Rational d, bool *) const;
+  Real get_duration_space (Rational d) const;
 };
 #endif /* SPACING_OPTIONS_HH */
index 3018cadebcfffdc4a375a4d6cdcd05edf8bda39d..60302736bdf66ee6c1f9144afec41230aa46b070 100644 (file)
@@ -23,7 +23,6 @@ private:
                                     Paper_column *nextr,
                                     Spacing_options const *options);
   static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment);
-  static Real get_duration_space (Moment dur, Spacing_options const *, bool *);
   static Rational effective_shortest_duration (Grob *me, vector<Grob*> const &all);
   static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *);
   static void prune_loose_columns (Grob *, vector<Grob*> *cols, Spacing_options  *);
@@ -34,7 +33,7 @@ private:
   static bool fills_measure (Grob *, Item *, Item *);
 public:
   static vector<Grob*> get_columns (Grob *me);
-  static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *);
+  static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *);
   static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r,
                                                 Real *fixed, Real *space,
                                                 Spacing_options const *);
index e0d9daaa00d7365b928b40885c014d7fd8d6d2e8..0d73b4af0bebd07e5c3b82b90662d4aa55c156c8 100644 (file)
@@ -76,10 +76,7 @@ Spacing_spanner::standard_breakable_column_spacing (Grob *me, Item *l, Item *r,
          *space = *fixed + 0.5;
        }
       else
-       {
-         bool dummy;
-         *space = *fixed + options->get_duration_space (dt.main_part_, &dummy);
-       }
+       *space = *fixed + options->get_duration_space (dt.main_part_);
     }
 }
 
@@ -106,8 +103,7 @@ get_measure_length (Grob *column)
 
 Real
 Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
-                              Spacing_options const *options,
-                              bool *expand_only)
+                              Spacing_options const *options)
 {
   (void) me;
   
@@ -151,8 +147,7 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
   Real dist = 0.0;
   if (delta_t.main_part_ && !lwhen.grace_part_)
     {
-      dist = options->get_duration_space (shortest_playing_len.main_part_,
-                                         expand_only);
+      dist = options->get_duration_space (shortest_playing_len.main_part_);
       dist *= double (delta_t.main_part_ / shortest_playing_len.main_part_);
     }
   else if (delta_t.grace_part_)
@@ -162,14 +157,13 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
        available (namely the space for the global shortest note), and
        multiply that by grace-space-factor
       */
-      dist = options->get_duration_space (options->global_shortest_, expand_only) / 2.0;
+      dist = options->get_duration_space (options->global_shortest_) / 2.0;
       Grob *grace_spacing = unsmob_grob (lc->get_object ("grace-spacing"));
       if (grace_spacing)
        {
          Spacing_options grace_opts;
          grace_opts.init_from_grob (grace_spacing);
-         bool bla;
-         dist = grace_opts.get_duration_space (delta_t.grace_part_, &bla);
+         dist = grace_opts.get_duration_space (delta_t.grace_part_);
        }
       
     }
index 920e66bd03a04eada7338482014d4e5d5b166d12..e491730869194be0ea929912f6231701285a6917 100644 (file)
@@ -155,9 +155,8 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c,
              */
              Real space = 0.0;
              Real fixed = 0.0;
-             bool dummy = false;
                  
-             Real base = note_spacing (me, lc, rc, options, &dummy);
+             Real base = note_spacing (me, lc, rc, options);
              Note_spacing::get_spacing (sp, rc, base, options->increment_,
                                         &space, &fixed);
 
index 3a69e26802aa46cd42ad2e78bd58df58efd3beed..ee19b29ab766c14176bab2c7b7dce116ad463a23 100644 (file)
@@ -119,13 +119,12 @@ set_loose_columns (System *which, Column_x_positions const *posns)
          else
            programming_error ("Column without spacing object");
 
-         bool expand_only = false;
          Real base_note_space = 0.0;
 
          if (Paper_column::is_musical (next_col)
              && Paper_column::is_musical (loose_col))
-           base_note_space = Spacing_spanner::note_spacing (spacing, loose_col, next_col, 
-                                                            &options, &expand_only);
+           base_note_space = Spacing_spanner::note_spacing (spacing, loose_col, next_col,
+                                                            &options);
          else
            {
              Real fixed, space;
index 8c7b7c3ca5191002cc1477be2d0e666552eb71d7..a3e512525b5c8352a825e08f81f2fc95cfbedcf5 100644 (file)
@@ -56,8 +56,7 @@ Spacing_options::Spacing_options ()
   Get the measure wide ant for arithmetic spacing.
 */
 Real
-Spacing_options::get_duration_space (Rational d,
-                                    bool *expand_only) const
+Spacing_options::get_duration_space (Rational d) const
 {
   Real k = shortest_duration_space_;
 
@@ -92,7 +91,6 @@ Spacing_options::get_duration_space (Rational d,
       */
       Real log = log_2 (global_shortest_);
       k -= log;
-      *expand_only = false;
 
       return (log_2 (d) + k) * increment_;
     }
index a61bffb98a3aa41d7a417ee493a17e7412e127b0..13c2964edba19d063947005f41e6935892a143d0 100644 (file)
@@ -167,15 +167,10 @@ Spacing_spanner::generate_pair_spacing (Grob *me,
 {
   if (Paper_column::is_musical (left_col))
     {
-      bool skip_unbroken_right = false;
-
       if (!Paper_column::is_musical (right_col)
          && options->float_nonmusical_columns_
          && after_right_col
          && Paper_column::is_musical (after_right_col))
-       skip_unbroken_right = true;
-
-      if (skip_unbroken_right)
        {
          /*
            TODO: should generate rods to prevent collisions.
@@ -233,8 +228,7 @@ Spacing_spanner::generate_springs (Grob *me,
 }
 
 /*
-  Generate the space between two musical columns LEFT_COL and RIGHT_COL, given
-  spacing parameters INCR and SHORTEST.
+  Generate the space between two musical columns LEFT_COL and RIGHT_COL.
 */
 void
 Spacing_spanner::musical_column_spacing (Grob *me,
@@ -242,8 +236,7 @@ Spacing_spanner::musical_column_spacing (Grob *me,
                                         Item *right_col,
                                         Spacing_options const *options)
 {
-  bool expand_only = false;
-  Real base_note_space = note_spacing (me, left_col, right_col, options, &expand_only);
+  Real base_note_space = note_spacing (me, left_col, right_col, options);
 
   Real max_fixed = 0;
   Real max_space = 0;
index 79e70286445b3844169be78dea600fa7261defe7..e688d60cfbcbcbb300de09907c4179f05d067a61 100644 (file)
@@ -71,15 +71,6 @@ Staff_spacing::next_note_correction (Grob *me,
   if (bar_size.is_empty ())
     left_stickout_correction *= 0.75;
 
-  /*
-    We want 0.3 ss before the sticking-out object.
-    
-    current_fixed/2 is our guess at (right side of left object + 0.3)
-   */
-  left_stickout_correction += current_fixed/2 - current_space;
-  left_stickout_correction = max (left_stickout_correction, 0.0);
-
-  
   Real optical_corr = 0.0;
   Grob *stem = Note_column::get_stem (g);
   if (!bar_size.is_empty ()
@@ -164,8 +155,9 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob,
                                      )
 {
   Interval bar_size = bar_y_positions (last_grob);
+  Grob *orig = me->original () ? me->original () : me;
 
-  extract_grob_set (me, "right-items", right_items);
+  extract_grob_set (orig, "right-items", right_items);
 
   *compound_fixed = 0.0;
   *compound_space = 0.0;