]> git.donarmstrong.com Git - lilypond.git/commitdiff
(stem_dir_correction): don't inspect
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 13 Jun 2006 12:24:23 +0000 (12:24 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 13 Jun 2006 12:24:23 +0000 (12:24 +0000)
stem_end_position if correct_stem_dirs isn't set. Backportme.

ChangeLog
lily/least-squares.cc
lily/note-spacing.cc
lily/stem.cc

index 364957f6b66f38d72331330eb3e8c5443720acff..b642a390cf3be2fb7cc748203a2b21838e3d86e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-06-13  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * lily/note-spacing.cc (stem_dir_correction): don't inspect
+       stem_end_position if correct_stem_dirs isn't set. Backportme. 
+
        * lily/tuplet-bracket.cc (calc_positions): look at
        stem-end-position for tuplet bracket slope. Fixes sloped tuplet
        brackets narrower than beams. Backportme.
index c7ca185bbfa4ea8de4763339bbaf30c65dab0edb..2e0bcab3c61a8e6fb7bcd36a903db2a6244882be 100644 (file)
@@ -28,22 +28,23 @@ minimise_least_squares (Real *coef, Real *offset,
       sqx += sqr (x);
       sxy += x*y;
     }
-  int N = input.size ();
+
+  int count = input.size ();
 
   *coef = 0.0;
   *offset = 0.;
 
-  Real den = (N * sqx - sqr (sx));
-  if (!N || !den)
+  Real den = (count * sqx - sqr (sx));
+  if (!count || !den)
     {
       programming_error ("minimise_least_squares ():  Nothing to minimise");
       *coef = 0.0;
-      *offset = N ? sy / N : 0.0;
+      *offset = count ? sy / count : 0.0;
     }
   else
     {
-      *coef = (N *sxy - sx * sy) / den;
-      *offset = (sy - (*coef) * sx) / N;
+      *coef = (count * sxy - sx * sy) / den;
+      *offset = (sy - (*coef) * sx) / count;
     }
 }
 
index 8586cc5f4cd209d6dd508117795eb587d61600d3..cb68f6b2df37937f56897d9d539291cb96ed31ce 100644 (file)
@@ -323,12 +323,14 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn,
            correct_stem_dirs = false;
 
          Interval hp = Stem::head_positions (stem);
-         if (!hp.is_empty ())
+         if (correct_stem_dirs
+             && !hp.is_empty ())
            {
              Real chord_start = hp[sd];
              Real stem_end = Stem::stem_end_position (stem);
 
-             stem_posns[d] = Interval (min (chord_start, stem_end), max (chord_start, stem_end));
+             stem_posns[d] = Interval (min (chord_start, stem_end),
+                                       max (chord_start, stem_end));
              head_posns[d].unite (hp);
            }
        }
index 05fc5e7417cfac2d95256cabd85a350ff5bd3522..8527a21553fe116ffd64470cf9051d3533c03720 100644 (file)
@@ -229,6 +229,10 @@ MAKE_SCHEME_CALLBACK (Stem, pure_height, 3)
 SCM
 Stem::pure_height (SCM smob, SCM start, SCM end)
 {
+  (void) start;
+  (void) end;
+  
+  
   Grob *me = unsmob_grob (smob);
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real len = scm_to_double (calc_length (smob)) * ss / 2;
@@ -256,6 +260,11 @@ Stem::calc_stem_end_position (SCM smob)
   if (!head_count (me))
     return scm_from_double (0.0);
 
+  if (Grob *beam = unsmob_grob (me->get_object ("beam")))
+    {
+      (void) beam->get_property ("quantized-positions");
+      return me->get_property ("stem-end-position");
+    }
   
   Real ss = Staff_symbol_referencer::staff_space (me);
   int durlog = duration_log (me);