From 0fe0d0ce27377d145336c9046e89aab9d93a1058 Mon Sep 17 00:00:00 2001 From: hanwen Date: Tue, 23 Jul 2002 12:40:33 +0000 Subject: [PATCH] (robust_list_ref): be sensible with negative argument. This fixes too-long stems on half and quarter notes. --- ChangeLog | 5 +++++ lily/lily-guile.cc | 5 +++-- lily/stem.cc | 4 +--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f31ce7f9e0..0de1b315d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-07-23 Han-Wen + + * 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 * Documentation/index.texi: Add, fix, change some links and names, diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 6f8bcbe4c0..02bfeef901 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -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); diff --git a/lily/stem.cc b/lily/stem.cc index 32ccc700b8..502ca9dc5c 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -285,7 +285,7 @@ Stem::get_default_stem_end_position (Grob*me) SCM s; Array 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)); -- 2.39.5