diff --git a/src/st7735/gfx.rs b/src/st7735/gfx.rs index d0cda1b..7ca4c4a 100644 --- a/src/st7735/gfx.rs +++ b/src/st7735/gfx.rs @@ -31,14 +31,14 @@ pub trait GFX : PrimitveGFX { let steep_dir_vertical = ((y1 as i16) - (y0 as i16)).abs() > ((x1 as i16) - (x0 as i16)).abs(); - let (x0, y0, x1, y1) = if (steep_dir_vertical) { + let (x0, y0, x1, y1) = if steep_dir_vertical { (y0, x0, y1, x1) } else { (x0, y0, x1, y1) }; - let (x0, y0, x1, y1) = if (x0 > x1) { + let (x0, y0, x1, y1) = if x0 > x1 { (x1, y1, x0, y0) } else { @@ -51,7 +51,7 @@ pub trait GFX : PrimitveGFX { let mut err = dx / 2; - let y_step : i16 = if (y0 < y1) { + let y_step : i16 = if y0 < y1 { 1 } else { -1 @@ -62,8 +62,8 @@ pub trait GFX : PrimitveGFX { let mut cur_y = y0 as i16; for cur_x in x0..(x1 + 1) { err -= dy; - if (err < 0) { - if (steep_dir_vertical) { + if err < 0 { + if steep_dir_vertical { self.draw_fast_vline(cur_y as u8, seg, cur_x - seg + 1, color); } else { self.draw_fast_hline(seg, cur_y as u8, cur_x - seg + 1, color); diff --git a/src/st7735/mod.rs b/src/st7735/mod.rs index 74d74bd..4887744 100644 --- a/src/st7735/mod.rs +++ b/src/st7735/mod.rs @@ -517,10 +517,10 @@ impl bitmaps::BitmapGFX for St7735IO return; } - if((x + bitmap.width - 1) >= self.st7735.width) { + if (x + bitmap.width - 1) >= self.st7735.width { return; } - if((y + bitmap.height - 1) >= self.st7735.height) { + if (y + bitmap.height - 1) >= self.st7735.height { return; } @@ -551,10 +551,10 @@ impl bitmaps::BitmapGFX for St7735IO return; } - if((x + bitmap.width - 1) >= self.st7735.width) { + if (x + bitmap.width - 1) >= self.st7735.width { return; } - if((y + bitmap.height - 1) >= self.st7735.height) { + if (y + bitmap.height - 1) >= self.st7735.height { return; }