From 1e9043347ca350772450f8a4879a01158965091e Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:24:40 +0000 Subject: [PATCH] lilypond-1.3.71 --- VERSION | 2 +- lily/spaceable-element.cc | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/VERSION b/VERSION index 7da8041297..be67f6cfe8 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=70 +PATCH_LEVEL=71 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/lily/spaceable-element.cc b/lily/spaceable-element.cc index 7f746ee4d6..6bc4c1893f 100644 --- a/lily/spaceable-element.cc +++ b/lily/spaceable-element.cc @@ -17,14 +17,16 @@ Spaceable_element::get_minimum_distances ( Score_element*me) return me->get_elt_property ("minimum-distances"); } +/*todo: merge code of spring & rod? + */ void Spaceable_element::add_rod (Score_element *me , Score_element * p, Real d) { SCM mins = get_minimum_distances (me); - SCM newdist= gh_double2scm (d); - for (; gh_pair_p (mins); mins = gh_cdr (mins)) + SCM newdist = gh_double2scm (d); + for (SCM s = mins; gh_pair_p (s); s = gh_cdr (s)) { - SCM dist = gh_car (mins); + SCM dist = gh_car (s); if (gh_car (dist) == p->self_scm_) { gh_set_cdr_x (dist, scm_max (gh_cdr (dist), @@ -37,34 +39,32 @@ Spaceable_element::add_rod (Score_element *me , Score_element * p, Real d) me->set_elt_property ("minimum-distances", mins); } -SCM -Spaceable_element::get_ideal_distances (Score_element*me) -{ - return me->get_elt_property ("ideal-distances"); -} - void -Spaceable_element::add_spring (Score_element*me, Score_element * p, Real d, Real s) +Spaceable_element::add_spring (Score_element*me, Score_element * p, Real d, Real strength) { SCM mins = get_ideal_distances (me); SCM newdist= gh_double2scm (d); - for (; gh_pair_p (mins); mins = gh_cdr (mins)) + for (SCM s = mins; gh_pair_p (s); s = gh_cdr (s)) { - SCM dist = gh_car (mins); + SCM dist = gh_car (s); if (gh_car (dist) == p->self_scm_) { programming_error("already have that spring"); - /* gh_set_car_x (gh_cdr (dist), scm_max (gh_cadr (dist), - newdist));*/ return ; } } - SCM newstrength= gh_double2scm (s); + SCM newstrength= gh_double2scm (strength); mins = gh_cons (gh_cons (p->self_scm_, gh_cons (newdist, newstrength)), mins); me->set_elt_property ("ideal-distances", mins); } +SCM +Spaceable_element::get_ideal_distances (Score_element*me) +{ + return me->get_elt_property ("ideal-distances"); +} + void Spaceable_element::remove_interface (Score_element*me) -- 2.39.5