]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fixes the reading of the positions property in tuplet-number.cc.
authorMike Solomon <mike@apollinemike.com>
Sat, 1 Oct 2011 18:05:12 +0000 (20:05 +0200)
committerMike Solomon <mike@apollinemike.com>
Sat, 1 Oct 2011 18:05:12 +0000 (20:05 +0200)
Positions can theoretically be "empty" if the left is higher than
the right.  Thus, to find its center, we don't use the interval
center function and instead find the center manually.

lily/tuplet-number.cc

index aaa862395d7163651e74918e45622b9e61e1820d..72c40f37f1260802a44b90b57f1620714d274ea5 100644 (file)
@@ -79,8 +79,7 @@ Tuplet_number::calc_y_offset (SCM smob)
   Spanner *tuplet = unsmob_spanner (me->get_object ("bracket"));
 
   Interval positions = robust_scm2interval (tuplet->get_property ("positions"), Interval (0.0, 0.0));
-
-  return scm_from_double (positions.center ());
+  return scm_from_double ((positions[LEFT] + positions[RIGHT]) / 2.0);
 }
 
 MAKE_SCHEME_CALLBACK (Tuplet_number, calc_cross_staff, 1)