]> git.donarmstrong.com Git - lilypond.git/commitdiff
Skylines: reject steep-sloped buildings; issue 3383
authorKeith OHara <k-ohara5a5a@oco.net>
Sat, 24 Aug 2013 06:13:40 +0000 (23:13 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Fri, 30 Aug 2013 20:05:20 +0000 (13:05 -0700)
lily/skyline.cc

index 8654f0d973d26af771c106c44d441908dcb9fb27..70bf9898616836e93b83a8398b5d473c5aada777 100644 (file)
@@ -125,6 +125,12 @@ Building::precompute (Real start, Real start_height, Real end_height, Real end)
       assert (start_height == end_height);
       y_intercept_ = start_height;
     }
+  else if (fabs(slope_) > 1e6)
+    // too steep to be stored in slope-intercept form, given round-off error
+    {
+      slope_ = 0.0;
+      y_intercept_ = max(start_height, end_height);
+    }
   else
     y_intercept_ = start_height - slope_ * start;
 }