]> git.donarmstrong.com Git - lilypond.git/commitdiff
(robust_list_ref): be sensible with negative
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 23 Jul 2002 12:40:33 +0000 (12:40 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 23 Jul 2002 12:40:33 +0000 (12:40 +0000)
argument. This fixes too-long stems on half and quarter notes.

ChangeLog
lily/lily-guile.cc
lily/stem.cc

index f31ce7f9e0b6ece45673960164d08646ab133bf3..0de1b315d63fe8104ce86f91823e6c7b0c2ed3a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-23  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/lily-guile.cc (robust_list_ref): be sensible with negative
+       argument. This fixes too-long stems on half and quarter notes.
+
 2002-07-23  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * Documentation/index.texi: Add, fix, change some links and names,
index 6f8bcbe4c0a8619243ce76afc45393466b8773a5..02bfeef901e6e42d7924f5684872243571819c64 100644 (file)
@@ -816,14 +816,15 @@ int_list_to_slice (SCM l)
 
 
 /*
-  return I-th element, or last elt L
+  Return I-th element, or last elt L. If I < 0, then we take the first
+  element.
 
   PRE: length (L) > 0
  */
 SCM
 robust_list_ref(int i, SCM l)
 {
-  while (i--  && gh_pair_p (gh_cdr(l)))
+  while (i-- > 0 && gh_pair_p (gh_cdr(l)))
     l = gh_cdr (l);
 
   return gh_car(l);
index 32ccc700b85a6b12e4f88e42503effd2e74fe0e5..502ca9dc5cbdf527edff070570fe4874c3f62a75 100644 (file)
@@ -285,7 +285,7 @@ Stem::get_default_stem_end_position (Grob*me)
   SCM s;
   Array<Real> a;
 
-  Real length_f = 0.;
+  Real length_f = 3.5;
   SCM scm_len = me->get_grob_property ("length");
   if (gh_number_p (scm_len))
     {
@@ -294,8 +294,6 @@ Stem::get_default_stem_end_position (Grob*me)
   else
     {
       s = me->get_grob_property ("lengths");
-      length_f = 3.5;
-      
       if (gh_pair_p (s))
        {
          length_f = 2* gh_scm2double (robust_list_ref (duration_log(me) -2, s));