]> git.donarmstrong.com Git - lilypond.git/commitdiff
Prevents division by 0 in Bar_line::calc_bar_extent.
authorMike Solomon <mike@apollinemike.com>
Tue, 18 Oct 2011 08:51:07 +0000 (10:51 +0200)
committerMike Solomon <mike@apollinemike.com>
Tue, 18 Oct 2011 08:51:07 +0000 (10:51 +0200)
lily/bar-line.cc

index e256e8fe55f16ceb8626bc134b08c0ef3c5f8e43..a22cd053b818177ea45b46be6889df0a001a51a4 100644 (file)
@@ -46,9 +46,9 @@ Bar_line::calc_bar_extent (SCM smob)
       */
       SCM bar_line_color = me->get_property ("color");
       SCM staff_color = staff->get_property ("color");
-      if (bar_line_color == staff_color)
-       result *= (1 - 0.5 * (Staff_symbol_referencer::line_thickness (me) /
-                             Staff_symbol_referencer::staff_radius (me)));
+      Real radius = Staff_symbol_referencer::staff_radius (me);
+      if (bar_line_color == staff_color && radius)
+       result *= (1 - 0.5 * (Staff_symbol_referencer::line_thickness (me) / radius));
     }
   return ly_interval2scm (result);
 }