Add iterator over points in rect
This commit is contained in:
parent
4f14d70152
commit
e31eea8178
2 changed files with 13 additions and 11 deletions
|
|
@ -59,12 +59,8 @@ impl<'a> View<'a> {
|
|||
// More complicated drawing primitives
|
||||
|
||||
pub fn rect(&mut self, area: Rect, color: Srgba) {
|
||||
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);
|
||||
}
|
||||
for pos in area.points() {
|
||||
self.set(pos, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue