From 051c76428a9822c02ff46d5b82cbbb5094b6cade Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:56:24 +0000 Subject: [PATCH] lilypond-1.3.92 --- input/test/rest-collision.ly | 13 ++++++++++++- lily/rest-collision.cc | 33 ++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/input/test/rest-collision.ly b/input/test/rest-collision.ly index c6944f7ea6..c424161dba 100644 --- a/input/test/rest-collision.ly +++ b/input/test/rest-collision.ly @@ -6,6 +6,17 @@ scale = \notes \relative c' { rests = \notes { r r r r r r r r r r r r r r r r } +different =< \context Voice = one { + \stemup + \notes \relative c'' { + r8 a e4 a e + } + } + \context Voice = two { + \stemdown + \notes \relative c'' { + r1 + }} > scales = \context Staff \notes < \context Voice=i { \stemup r1 r2 r2 \scale c''1 c'2 a'2 \rests } @@ -27,7 +38,7 @@ restsII = \context Staff \notes { [c8 r8 c8 c8] [c''8 r8 c''8 c''8] [c'8 r8 r8 c'''8] - + \different } } diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 952bded8fa..a6cecb9013 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -51,6 +51,10 @@ Rest_collision::add_column (Score_element*me,Score_element *p) p->set_elt_property ("rest-collision", me->self_scm ()); } + +/* + Combination of dot-count and duration-log. + */ static SCM head_characteristic (Score_element * col) { @@ -105,11 +109,6 @@ Rest_collision::do_shift (Score_element *me, SCM elts) // meisjes met meisjes if (!notes.size()) { - - /* - FIXME: col2rhythmic_head and rhythmic_head2mom sucks bigtime. - - */ SCM characteristic = head_characteristic (rests[0]); int i = 1; for (; i < rests.size (); i++) @@ -142,13 +141,29 @@ Rest_collision::do_shift (Score_element *me, SCM elts) display_count = rests.size (); /* - UGH. Should get dims from table. Should have minimum dist. + Ugh. Should have minimum dist. + + Ugh. What do we do if we have three different rests? + */ - int dy = display_count > 2 ? 6 : 4; + int dy = display_count > 2 ? 6 : 4; // FIXME Should get dims from table. if (display_count > 1) { - Note_column::translate_rests (rests[0],dy); - Note_column::translate_rests (rests[1], -dy); + Direction d0 = Note_column::dir (rests[0]); + Direction d1 = Note_column::dir (rests[1]); + + if (!d0 && !d1) + { + d0= UP; + d1 = DOWN; + } + else if (!d0) + d0 = - d1; + else if (!d1) + d1 = -d0; + + Note_column::translate_rests (rests[0],d0 *dy); + Note_column::translate_rests (rests[1], d1 *dy); } } // meisjes met jongetjes -- 2.39.5