]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parser.yy (simple_string): allow \new STRING_IDENTIFIER.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Aug 2005 13:36:43 +0000 (13:36 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Aug 2005 13:36:43 +0000 (13:36 +0000)
* flower/rational.cc (operator +): prevent overflow. This fixes
heavily nested tuplets.

ChangeLog
flower/rational.cc
lily/parser.yy
lily/tuplet-bracket.cc

index bffb1b13933d934cfa0832c94cf358d1bb18096f..0a9c37ee4ca2305767ce0b6ff7652e1b5a02edb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-08-04  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/parser.yy (simple_string): allow \new STRING_IDENTIFIER.
+
+       * flower/rational.cc (operator +): prevent overflow. This fixes
+       heavily nested tuplets.
+
        * lily/auto-beam-engraver.cc (derived_mark): new method. Yes. We
        have to protect even those unlikely to be corrupted data members.  
 
index f8ac098697b0ad5ac00b9c5cd6246d3805867a00..9ab8dcc4cdce191bebf014fc18a2f5028bc1108b 100644 (file)
@@ -171,8 +171,9 @@ Rational::operator += (Rational r)
     *this = r;
   else
     {
-      int n = sign_ * num_ * r.den_ + r.sign_ * den_ * r.num_;
-      int d = den_ * r.den_;
+      int lcm =  (den_ / gcd (r.den_, den_)) * r.den_;
+      int n = sign_ * num_ * (lcm / den_) + r.sign_ * r.num_ * (lcm / r.den_);
+      int d = lcm;
       sign_ = ::sign (n) * ::sign (d);
       num_ = abs (n);
       den_ = abs (d);
index 85b2fb1cb70745465854507988e97fc8573a5157..5662c99439d3fe89088d8a654e0b5077a95db4ee 100644 (file)
@@ -1513,6 +1513,9 @@ simple_string: STRING {
        | LYRICS_STRING {
                $$ = $1;
        }
+       | STRING_IDENTIFIER {
+               $$ = $1;
+       }
        ;
 
 scalar: string {
index bac817dddd97ac4572de37c58c4a3b29bb5ad321..bb55ca2d018b7ac3776cc53b2e4ec3fac8ee8f6d 100644 (file)
@@ -386,6 +386,9 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
   commony = common_refpoint_of_array (tuplets, commony, Y_AXIS);
   Grob *commonx = common_refpoint_of_array (columns, me, X_AXIS);
   commonx = common_refpoint_of_array (tuplets, commonx, Y_AXIS);
+  commonx = commonx->common_refpoint (me->get_bound (LEFT), X_AXIS);
+  commonx = commonx->common_refpoint (me->get_bound (RIGHT), X_AXIS);
+
 
   Interval staff;
   if (Grob *st = Staff_symbol_referencer::get_staff_symbol (me))
@@ -662,7 +665,8 @@ ADD_INTERFACE (Tuplet_bracket,
               "tuplet-bracket-interface",
               "A bracket with a number in the middle, used for tuplets. "
               "When the bracket spans  a line break, the value of "
-              "@code{break-overshoot} determines how far it extends beyond the staff. "
+              "@code{break-overshoot} determines how far it extends "
+              "beyond the staff. "
               "At a line break, the markups in the @code{edge-text} are printed "
               "at the edges. ",