Implemented guess for draw_pixel

This commit is contained in:
Zac Wilson 2025-12-20 19:35:33 +00:00
parent 78b6442fe3
commit c91b1d8fe6

View file

@ -210,7 +210,18 @@ impl DoubleFrame<AutomaticPartialWindow> {
impl<PartialWindow: ApplyPartialWindow> DoubleFrame<PartialWindow> {
pub fn draw_pixel(&mut self, x: u16, y: u16, colour: PixelColour) {
todo!()
self.partial_window.update_partial_window(x, x, y, y);
let x_i = x / 8;
let x_shift = x % 8;
let i = y * (EPD_WIDTH as u16 / 8) + x_i;
match colour {
PixelColour::Black => {
self.new.0[i as usize] &= !(1 << x_shift);
},
PixelColour::White => {
self.new.0[i as usize] |= 1 << x_shift;
},
}
}
}