From d049a1f5d047738fd88ab0d6a119634ad93f57ad Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Tue, 4 Mar 2008 16:01:27 +0100 Subject: [PATCH] Second attempt to fix tuplet numbers for single-note tuplets If we have a single note tuplet, we mustn't kill the bracket (which will also kill the number), but only hide the bracket. --- lily/tuplet-bracket.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 956da75f3d..5a285efcbf 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -280,16 +280,20 @@ Tuplet_bracket::print (SCM smob) else if (bracket == ly_symbol2scm ("if-no-beam")) bracket_visibility = !par_beam; - /* Don't print a tuplet bracket if no control-points were calculated or the tuplet - does not span any time, i.e. a single-note tuplet */ + /* Don't print a tuplet bracket and number if no control-points were calculated */ SCM cpoints = me->get_property ("control-points"); - if (scm_ilength (cpoints) < 2 || - robust_scm2moment (me->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0)) - == robust_scm2moment (me->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0))) + if (scm_ilength (cpoints) < 2 ) { me->suicide (); return SCM_EOL; } + /* if the tuplet does not span any time, i.e. a single-note tuplet, hide + the bracket, but still let the number be displayed */ + if (robust_scm2moment (me->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0)) + == robust_scm2moment (me->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0))) + { + bracket_visibility = false; + } Drul_array points; points[LEFT] = ly_scm2offset (scm_car (cpoints)); -- 2.39.5