geometry: rewrite Coordinates trait into a concrete struct, pass coords by reference to shaders, and add a Rectangle type

This commit is contained in:
2024-11-16 11:31:45 +01:00
parent a23b2e8e94
commit e329a56c90
4 changed files with 89 additions and 32 deletions

View File

@ -72,7 +72,7 @@ impl<T: SmartLedsWrite<Color = Rgb<u8>>, S: Surface> Display<S> for SmartLedDisp
let mut pixel = Rgb::new(0, 0, 0);
for surface in self.surfaces.iter() {
surface.with_shader(|shader| {
pixel = pixel.saturating_add(shader.draw(virt_coords.clone()));
pixel = pixel.saturating_add(shader.draw(&virt_coords));
})
}
self.total_mw += pixel.as_milliwatts();