From f881075c4a952dcd857a78a09905b6013b73ca71 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Sat, 14 Oct 2023 11:36:08 +0200 Subject: [PATCH] Clear background in draw --- src/bin/draw/measurements.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/draw/measurements.rs b/src/bin/draw/measurements.rs index aef86a3..82687a0 100644 --- a/src/bin/draw/measurements.rs +++ b/src/bin/draw/measurements.rs @@ -16,7 +16,7 @@ use embedded_graphics::{ use raspi_oled::Events; use time::{format_description, Date, OffsetDateTime, PrimitiveDateTime}; -use crate::{screensaver::Screensaver, Context, ContextDefault, Draw}; +use crate::{screensaver::Screensaver, Context, ContextDefault, Draw, BLACK}; use time_tz::{timezones::db::europe::BERLIN, OffsetDateTimeExt, PrimitiveDateTimeExt}; static CLOCK_FONT: MonoFont = MonoFont { @@ -89,6 +89,7 @@ impl> Draw for Measurements { if self.drawn.load(std::sync::atomic::Ordering::Relaxed) { return Ok(false); } + disp.clear(BLACK)?; let events = fs::read_to_string("events.json").expect("failed to read events.json"); let events: Events = serde_json::from_str(&events).unwrap(); let database = ctx.database();