diff --git a/src/main.rs b/src/main.rs index 427095b..e9c9fc4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -116,12 +116,13 @@ impl Tail { let prev = self.previous(index); - if self.head == index { + if point.x == 0. || point.y == 0. || prev.x == -1. || prev.y == -1. { + // Don't have lines that cross the whole screen while using 1D graph + // draw_circle(point.x, point.y,THICKNESS, color); + } else if self.head == index { // Draw the head differently draw_circle(point.x, point.y,THICKNESS*2., color); - } else if point.x == 0. || point.y == 0. || prev.x == -1. || prev.y == -1. { - // Don't have lines that cross the whole screen while using 1D graph - draw_circle(point.x, point.y,THICKNESS, color); + draw_line(point.x, point.y, prev.x, prev.y, THICKNESS, color); } else if prev == self.points[self.head] { // Prevent the tail from connecting to the head draw_circle(point.x, point.y,THICKNESS, color); @@ -148,7 +149,7 @@ async fn main() { // Dot params let mut y_displacement = 0.; let mut x_displacement = 0.; - let mut tail = Tail::new(Axis::Two); + let mut tail = Tail::new(Axis::One); // Selection box let mut inital_x_pos = 0.;