From 7e0a0623b3ef0d64dbb300c278191aa781bea2ff Mon Sep 17 00:00:00 2001 From: Saphereye Date: Mon, 1 Jul 2024 10:34:01 +0530 Subject: [PATCH] fix: fixed #7, added a check before passing the points Ideally should add the check in th distribution, and they could return `Option`, but that might complicate stuff --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d0e3f3c..3ee641f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -500,7 +500,7 @@ fn ui( point_data.0.clear(); drawing_history.0.clear(); - if point_data.1.is_empty() { + if point_data.1.is_empty() && point_data.3 > 0 { (0..=point_data.3).for_each(|i| match distribution.0 { DistributionType::Fibonacci => { let color = Color::hsl(360. * i as f32 / point_data.3 as f32, 0.95, 0.7);