From 8416412993eaeb44b142030cc5e54aef30e1e8df Mon Sep 17 00:00:00 2001 From: phixxy Date: Fri, 2 Feb 2024 23:03:01 -0800 Subject: [PATCH] fixing bug in phat display --- extensions/inky_phat.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extensions/inky_phat.py b/extensions/inky_phat.py index d0cefde..ffc4c15 100644 --- a/extensions/inky_phat.py +++ b/extensions/inky_phat.py @@ -35,15 +35,16 @@ class InkyScreen(commands.Cog): if text is not self.old_message: image = Image.new("P", (self.display.WIDTH, self.display.HEIGHT)) draw = ImageDraw.Draw(image) + width = self.display.WIDTH height = self.display.HEIGHT lines = len(text) height_diff = height/lines x = 0 y = 0 for line in text: - if x <= height: - draw.text((x, y), line, self.display.YELLOW) - x += height_diff + if y <= width: + draw.text((x, y), line, self.display.BLACK) + y += height_diff else: self.bot.logger.warning("InkyScreen: Text too long to fit on image.") self.display.set_image(image)