MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / paint

Method paint

user/src/bin/gui_rect.rs:29–42  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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))

Callers 2

move_rectMethod · 0.45
mainFunction · 0.45

Calls 1

drawMethod · 0.80

Tested by

no test coverage detected