From 3e445a21ae164cd85e1d208d9da9c2c236f23b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 12 Jun 2020 23:03:11 +0200 Subject: [PATCH] Fix interesting, but incorrect visual effect --- src/mode/graphics.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mode/graphics.rs b/src/mode/graphics.rs index fa88c566..0bf2ec25 100644 --- a/src/mode/graphics.rs +++ b/src/mode/graphics.rs @@ -113,11 +113,11 @@ where pub fn clear(&mut self) { self.buffer = GenericArray::default(); - let (width, height) = self.get_dimensions(); + // Let flush() clip these self.min_x = 0; - self.max_x = width - 1; + self.max_x = 255; self.min_y = 0; - self.max_y = height - 1; + self.max_y = 255; } /// Write out data to a display. @@ -162,7 +162,7 @@ where // umm... cast up and down, must cleanup let (x, y) = DROTATION::transform(x as u8, y as u8); - let idx = ((x as usize) / 8 * DSIZE::WIDTH as usize) + (y as usize); + let idx = ((y as usize) / 8 * DSIZE::WIDTH as usize) + (x as usize); let bit = y % 8; if let Some(byte) = self.buffer.get_mut(idx) {