From ae4230a6d75c7f802ba656c98d2ff2ab865a3710 Mon Sep 17 00:00:00 2001 From: Tony Robinson Date: Sun, 24 Sep 2023 16:17:31 +0100 Subject: [PATCH] Small change to fill() to exit early if there is nothing to do. This avoids running unnessary code and avoids a bug in set_window(). Signed-off-by: Tony Robinson --- wasp/draw565.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wasp/draw565.py b/wasp/draw565.py index 7944ae4..c3fa0ff 100644 --- a/wasp/draw565.py +++ b/wasp/draw565.py @@ -150,9 +150,11 @@ class Draw565(object): if h is None: h = display.height - y - display.set_window(x, y, w, h) - remaining = w * h + if remaining == 0: + return + + display.set_window(x, y, w, h) # Populate the line buffer buf = display.linebuffer