From 16321ccc9c0a17939c582ad1f0ecc3e8f3562b40 Mon Sep 17 00:00:00 2001 From: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com> Date: Mon, 21 Apr 2025 14:22:48 -0500 Subject: [PATCH] Fix TypeError in calendar update by returning y_pos on draw_event error --- src/calendar_manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calendar_manager.py b/src/calendar_manager.py index e841c183..39d3892b 100644 --- a/src/calendar_manager.py +++ b/src/calendar_manager.py @@ -98,6 +98,7 @@ class CalendarManager: def draw_event(self, event, y_start=1): """Draw a single calendar event on the canvas.""" + y_pos_at_start = y_start # Store the starting position try: # Get event details summary = event.get('summary', 'No Title') @@ -136,9 +137,11 @@ class CalendarManager: break self.display_manager.draw_text(line, y=y_pos, color=self.text_color, small_font=True) y_pos += 8 + 2 # Move down for the next line, add 2px spacing + return y_pos # Return the final y position if successful except Exception as e: logging.error(f"Error drawing calendar event: {str(e)}", exc_info=True) + return y_pos_at_start # Return the original starting position on error def _wrap_text(self, text, max_width, font): """Wrap text to fit within max_width using the provided font."""