Index: lily/cluster-engraver.cc =================================================================== RCS file: /cvsroot/lilypond/lilypond/lily/cluster-engraver.cc,v retrieving revision 1.1 diff -u -r1.1 cluster-engraver.cc --- lily/cluster-engraver.cc 13 Nov 2002 00:53:03 -0000 1.1 +++ lily/cluster-engraver.cc 15 Nov 2002 19:31:56 -0000 @@ -26,6 +26,7 @@ Pitch pitch_min, pitch_max; Spanner *cluster; SCM columns_scm; + bool about_finishing_b; }; void reset_min_max (Pitch *pitch_min, Pitch *pitch_max) @@ -81,10 +82,7 @@ { Grob *bound = unsmob_grob (get_property ("currentMusicalColumn")); cluster->set_bound (RIGHT, bound); - cluster->set_grob_property ("segments", columns_scm); - typeset_grob (cluster); - cluster = 0; - columns_scm = SCM_EOL; + about_finishing_b = true; } reqs_drul_[STOP] = 0; } @@ -98,6 +96,7 @@ { SCM basicProperties = get_property ("Cluster"); cluster = new Spanner (basicProperties); + about_finishing_b = false; columns_scm = SCM_EOL; Grob *bound = unsmob_grob (get_property ("currentMusicalColumn")); cluster->set_bound (LEFT, bound); @@ -122,28 +121,37 @@ if (column_scm == SCM_EOL) { programming_error("failed retrieving current column"); - return; } - - if (Pitch::compare (pitch_min, pitch_max) <= 0) + else { - int staff_position = pitch_min.steps (); - SCM c0 = get_property ("centralCPosition"); - if (gh_number_p (c0)) - staff_position += gh_scm2int (c0); - SCM segment = scm_list_n (column_scm, - gh_int2scm (staff_position), - pitch_min.smobbed_copy (), - pitch_max.smobbed_copy (), - SCM_UNDEFINED); - segment = scm_list_n (segment, SCM_UNDEFINED); - columns_scm = (columns_scm != SCM_EOL) ? - gh_append2 (columns_scm, segment) : segment; + if (Pitch::compare (pitch_min, pitch_max) <= 0) + { + int staff_position = pitch_min.steps (); + SCM c0 = get_property ("centralCPosition"); + if (gh_number_p (c0)) + staff_position += gh_scm2int (c0); + SCM segment = scm_list_n (column_scm, + gh_int2scm (staff_position), + pitch_min.smobbed_copy (), + pitch_max.smobbed_copy (), + SCM_UNDEFINED); + segment = scm_list_n (segment, SCM_UNDEFINED); + columns_scm = (columns_scm != SCM_EOL) ? + gh_append2 (columns_scm, segment) : segment; + } + else + { + /* This timestep is caused by a different voice of the + same staff and hence should be ignored. */ + } } - else + + if (about_finishing_b) { - /* This timestep is caused by a different voice of the same - staff and hence should be ignored. */ + cluster->set_grob_property ("segments", columns_scm); + typeset_grob (cluster); + cluster = 0; + columns_scm = SCM_EOL; } } }