Add Text widget
This commit is contained in:
parent
fe33465564
commit
dc6265f837
7 changed files with 373 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue