move drawpn to main thing

This commit is contained in:
0m.ax 2025-07-19 01:40:48 +02:00
parent ca1a207c99
commit ed8f12e179

View file

@ -56,7 +56,6 @@ trait Drawable {
fn rate(&self) -> u32;
fn draw_and_move(&mut self, display: &mut Display);
fn draw_png(&mut self, display: &mut Display, x: i32, y: i32);
}
impl BouncingImage {
/// Initializes a new BouncingImage.
@ -84,13 +83,6 @@ impl BouncingImage {
}
}
impl Drawable for BouncingImage {
fn rate(&self) -> u32 {
return self.rate;
}
/// Draws a PNG image at the given coordinates.
fn draw_png(&mut self, display: &mut Display, x: i32, y: i32) {
@ -104,6 +96,13 @@ impl Drawable for BouncingImage {
}
}
}
}
impl Drawable for BouncingImage {
fn rate(&self) -> u32 {
return self.rate;
}
/// Draws the image and updates its position.
fn draw_and_move(&mut self, display: &mut Display) {
self.draw_png(display, self.x, self.y);