| 27 | } |
| 28 | } |
| 29 | fn paint(&mut self) { |
| 30 | Rectangle::with_center(self.latest_pos, Size::new(RECT_SIZE, RECT_SIZE)) |
| 31 | .into_styled(PrimitiveStyle::with_stroke(Rgb888::RED, 10)) |
| 32 | .draw(&mut self.disp) |
| 33 | .ok(); |
| 34 | Circle::new(self.latest_pos + Point::new(-70, -300), 150) |
| 35 | .into_styled(PrimitiveStyle::with_fill(Rgb888::BLUE)) |
| 36 | .draw(&mut self.disp) |
| 37 | .ok(); |
| 38 | Triangle::new(self.latest_pos + Point::new(0, 150), self.latest_pos + Point::new(80, 200), self.latest_pos + Point::new(-120, 300)) |
| 39 | .into_styled(PrimitiveStyle::with_stroke(Rgb888::GREEN, 10)) |
| 40 | .draw(&mut self.disp) |
| 41 | .ok(); |
| 42 | } |
| 43 | fn unpaint(&mut self) { |
| 44 | Rectangle::with_center(self.latest_pos, Size::new(RECT_SIZE, RECT_SIZE)) |
| 45 | .into_styled(PrimitiveStyle::with_stroke(Rgb888::BLACK, 10)) |