]> git.donarmstrong.com Git - lilypond.git/commitdiff
prevent division by zero. release/2.11.14-1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 26 Jan 2007 02:56:01 +0000 (03:56 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 26 Jan 2007 02:56:01 +0000 (03:56 +0100)
lily/line-interface.cc

index c2e189c8d3fb353481028ef5cba31757724a7f50..b9155a07ab53b4c0a28638282392e23218deb6e7 100644 (file)
@@ -231,8 +231,14 @@ Line_interface::line (Grob *me, Offset from, Offset to)
       Real len = (to-from).length();
       
       int n = (int) rint ((len - period * fraction) / period);
-      period = ((to-from).length() - period * fraction) / n;
-
+      if (n > 0)
+       {
+         /*
+           TODO: figure out something intelligent for really short
+           sections.
+          */
+         period = ((to-from).length() - period * fraction) / n;
+       }
       stil = make_dashed_line (thick, from, to, period, fraction);
     }
   else