diff options
Diffstat (limited to 'evc/src/frame.rs')
-rw-r--r-- | evc/src/frame.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/evc/src/frame.rs b/evc/src/frame.rs index 81390a2..3c40a3d 100644 --- a/evc/src/frame.rs +++ b/evc/src/frame.rs @@ -49,6 +49,11 @@ impl Frame { pub fn view_area_mut<'a>(&'a mut self, offset: Vec2, size: Vec2) -> View<&'a mut Frame> { View::new(self, offset, size) } + pub fn set(&mut self, pos: Vec2, color: Pixel) { + if pos.x >= 0 && pos.y >= 0 && pos.x < self.size.x && pos.y < self.size.y { + self[pos] = color + } + } } impl Index<Vec2> for Frame { |