We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd2e230 commit d56c5d1Copy full SHA for d56c5d1
os/src/gui/paint.rs
@@ -28,7 +28,14 @@ impl DrawingBoard {
28
.draw(&mut self.graphics)
29
.ok();
30
}
31
+ fn unpaint(&mut self) {
32
+ Rectangle::with_center(self.latest_pos, Size::new(RECT_SIZE, RECT_SIZE))
33
+ .into_styled(PrimitiveStyle::with_stroke(Rgb888::BLACK, 1))
34
+ .draw(&mut self.graphics)
35
+ .ok();
36
+ }
37
pub fn move_rect(&mut self, dx: i32, dy: i32) {
38
+ self.unpaint();
39
self.latest_pos.x += dx;
40
self.latest_pos.y += dy;
41
self.paint();
0 commit comments