Skip to content

Commit

Permalink
Fix interesting, but incorrect visual effect
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Jun 12, 2020
1 parent ec0c97f commit 3e445a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mode/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3e445a2

Please sign in to comment.