]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-spacing.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / staff-spacing.cc
index c7023db3aa436bd59a234758620e0c7670438d30..79e70286445b3844169be78dea600fa7261defe7 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2001--2006  Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2001--2007  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "staff-spacing.hh"
@@ -42,6 +42,9 @@ Staff_spacing::next_note_correction (Grob *me,
   Item *col = dynamic_cast<Item *> (g)->get_column ();
   Real left_stickout_correction = max (0., (- g->extent (col, X_AXIS)[LEFT]));
 
+  /* staff space -> positions */
+  bar_size *= 2;
+
   /*
     Duh. If this gets out of hand, we should invent something more generic.
   */
@@ -87,8 +90,15 @@ Staff_spacing::next_note_correction (Grob *me,
       Direction d = get_grob_direction (stem);
       if (Stem::is_normal_stem (stem) && d == DOWN)
        {
-         Real stem_start = Stem::head_positions (stem) [DOWN];
-         Real stem_end = Stem::stem_end_position (stem);
+
+         /*
+           can't look at stem-end-position, since that triggers
+           beam slope computations.
+         */
+         Real stem_start = Stem::head_positions (stem) [d];
+         Real stem_end = stem_start + 
+           d * robust_scm2double (stem->get_property ("length"), 7);
+         
          Interval stem_posns (min (stem_start, stem_end),
                               max (stem_end, stem_start));
 
@@ -103,7 +113,7 @@ Staff_spacing::next_note_correction (Grob *me,
   Real correction = optical_corr + left_stickout_correction;
   if (correction)
     {
-      wish_count ++; 
+      (*wish_count) ++; 
 
       /*
        This minute adjustments don't make sense for widely spaced scores.