From 3c23baba8ea36bc741fbf3ea0916b955e829f66c Mon Sep 17 00:00:00 2001 From: Alex Severin Date: Sun, 31 Mar 2024 00:41:14 +0300 Subject: [PATCH] add assert for border eps --- src/drawing/conics.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drawing/conics.rs b/src/drawing/conics.rs index e40e2837..15dbfccd 100644 --- a/src/drawing/conics.rs +++ b/src/drawing/conics.rs @@ -326,6 +326,7 @@ mod tests { ((cx - x) as f32 / w).powi(2) + ((cy - y) as f32 / h).powi(2) } fn is_boundary_point(&self, (x, y): (i32, i32), boundary_eps: f32) -> bool { + assert!(boundary_eps >= 0.0); (self.normalized_distance_from_center((x, y)) - 1.0).abs() < boundary_eps } fn is_inner_point(&self, (x, y): (i32, i32)) -> bool {