Compare commits

..

2 Commits

Author SHA1 Message Date
proudmuslim-dev
1336ff3a42 Merge 6d499b0fd5 into 2cf0675a2d 2024-01-29 20:45:32 +00:00
proudmuslim-dev
6d499b0fd5 Fix embedded_graphics code + correct typo in chapter 3
Compiles now
2024-01-29 12:45:18 -08:00

View File

@@ -342,7 +342,7 @@ impl<'f> Display<'f> {
}; };
if (0..width).contains(&x) && (0..height).contains(&y) { if (0..width).contains(&x) && (0..height).contains(&y) {
let color = Color { red: color.r(), green: color.g(), blue: color.b() }; let color = Color::rgb(color.r(), color.g(), color.b());
set_pixel_in(self.framebuffer, Position { x, y }, color); set_pixel_in(self.framebuffer, Position { x, y }, color);
} }
@@ -360,9 +360,7 @@ impl<'f> DrawTarget for Display<'f> {
where where
I: IntoIterator<Item = Pixel<Self::Color>>, I: IntoIterator<Item = Pixel<Self::Color>>,
{ {
for pixel in pixels.into_iter() { pixels.into_iter().for_each(|p| self.draw_pixel(p));
self.draw_pixel(pixel);
}
Ok(()) Ok(())
} }