Fixed unecessary parentheses
This commit is contained in:
parent
2789acd044
commit
acfba93c0b
|
@ -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);
|
||||
|
|
|
@ -517,10 +517,10 @@ impl<SPIAddr, GPIOAddr> bitmaps::BitmapGFX for St7735IO<SPIAddr, GPIOAddr>
|
|||
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<SPIAddr, GPIOAddr> bitmaps::BitmapGFX for St7735IO<SPIAddr, GPIOAddr>
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue