]> git.donarmstrong.com Git - lilypond.git/commitdiff
Second attempt to fix tuplet numbers for single-note tuplets
authorReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 4 Mar 2008 15:01:27 +0000 (16:01 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 4 Mar 2008 15:01:27 +0000 (16:01 +0100)
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

index 956da75f3d376ac77736600ccd5259c6b151870a..5a285efcbff9ab3b9ad6fb9c2d683c860eb95d9f 100644 (file)
@@ -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<Offset> points;
   points[LEFT] = ly_scm2offset (scm_car (cpoints));