]> git.donarmstrong.com Git - lilypond.git/commitdiff
Show TupletBrackets also on single notes
authorReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 25 Feb 2008 17:32:46 +0000 (18:32 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 27 Feb 2008 14:59:52 +0000 (15:59 +0100)
While tuplet brackets should not be printed for tuplets consisting
of only one note (e.g. a note with tremolo!), the tuplet number still
needs to be printed and can not be ignored.

Since the tuplet number also uses the dimensions calculated by the tuplet
bracket, the tuplet bracket at least needs to calculate it's theoretical
size, too, even though it will not be printed for single-note tuplets. The
check to kill zero-length tuplet brackets has thus been moved from
calc_positions to print in Tuplet_bracket.

Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
lily/tuplet-bracket.cc
lily/tuplet-number.cc

index cfae0b98650d2317976c2ff9fae9338fe434a149..956da75f3d376ac77736600ccd5259c6b151870a 100644 (file)
@@ -280,8 +280,12 @@ 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 */
   SCM cpoints =  me->get_property ("control-points");
-  if (scm_ilength (cpoints) < 2)
+  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)))
     {
       me->suicide ();
       return SCM_EOL;
@@ -686,16 +690,6 @@ Tuplet_bracket::calc_positions (SCM smob)
 {
   Spanner *me = unsmob_spanner (smob);
 
-  /*
-    Don't print if it doesn't span time.
-   */
-  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)))
-    {
-      me->suicide ();
-      return SCM_EOL;
-    }
-
   Real dy = 0.0;
   Real offset = 0.0;
   calc_position_and_height (me, &offset, &dy);
index 22d857bdd2a2a2fb04f34eef3877de334230d2f1..78697ca4b11cf1953eccfe2420b6a49c9cec4a5a 100644 (file)
@@ -35,16 +35,6 @@ Tuplet_number::print (SCM smob)
       return SCM_EOL;
     }
 
-  /*
-    Don't print if it doesn't span time.
-   */
-  if (robust_scm2moment (tuplet->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0))
-      == robust_scm2moment (tuplet->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0)))
-    {
-      me->suicide ();
-      return SCM_EOL;
-    }
-
   SCM stc_scm = Text_interface::print (smob);
   Stencil *stc = unsmob_stencil (stc_scm);