diff --git a/examples/graphics-server/src/backend/betrusted.rs b/examples/graphics-server/src/backend/betrusted.rs index a5a4b31aa..1ac69cee8 100644 --- a/examples/graphics-server/src/backend/betrusted.rs +++ b/examples/graphics-server/src/backend/betrusted.rs @@ -107,6 +107,9 @@ impl DrawTarget for XousDisplay { /// Draw a `Pixel` that has a color defined as `BinaryColor`. fn draw_pixel(&mut self, pixel: Pixel) -> Result<(), Self::Error> { let Pixel(coord, color) = pixel; + if coord.x < 0 || coord.y < 0 { + return Ok(()) + } if coord.x < FB_WIDTH_PIXELS as _ && coord.y < FB_LINES as _ { let framebuffer = self.fb.as_mut_ptr() as *mut u32; let offset = (coord.x / 32 + coord.y * FB_WIDTH_WORDS as i32) as usize;