Compare commits

..

2 Commits

Author SHA1 Message Date
proudmuslim-dev
cfe0a56983 Merge 0c248d027e into 2cf0675a2d 2024-01-31 20:55:25 +00:00
proudmuslim-dev
0c248d027e Fix embedded_graphics code + correct typo in chapter 3
Compiles now
2024-01-31 12:55:20 -08:00

View File

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