]> git.donarmstrong.com Git - lilypond.git/commitdiff
prevent division by zero. release/2.10.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:57:19 +0000 (03:57 +0100)
lily/line-interface.cc

index 3f66437f3f7a651a66a97827cde99e8522196a16..dd306775af8a0920c3ee2b25c02532599eb61423 100644 (file)
@@ -134,8 +134,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