From: Han-Wen Nienhuys Date: Fri, 26 Jan 2007 02:56:01 +0000 (+0100) Subject: prevent division by zero. X-Git-Tag: release/2.10.14-1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a4261a7d4fd4e148363f4d6fdfb48e8a2597cdd5;p=lilypond.git prevent division by zero. --- diff --git a/lily/line-interface.cc b/lily/line-interface.cc index 3f66437f3f..dd306775af 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -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