Add Text widget

This commit is contained in:
Joscha 2024-03-07 19:00:20 +01:00
parent fe33465564
commit dc6265f837
7 changed files with 373 additions and 4 deletions

View file

@ -50,4 +50,16 @@ impl<'a> View<'a> {
pixel.0 = [color.red, color.green, color.blue];
}
}
// More complicated drawing primitives
pub fn rect(&mut self, area: Rect, color: Srgb) {
let nw = area.corner_nw();
let se = area.corner_se();
for y in nw.y..=se.y {
for x in nw.x..=se.x {
self.set(Vec2::new(x, y), color);
}
}
}
}