From 74036ed6d9decaa852648b9f0a632bb5b6ba7409 Mon Sep 17 00:00:00 2001 From: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:47:20 -0500 Subject: [PATCH] placement as % of matrix height --- src/music_manager.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/music_manager.py b/src/music_manager.py index 23df2aac..725c9317 100644 --- a/src/music_manager.py +++ b/src/music_manager.py @@ -757,12 +757,20 @@ class MusicManager: LINE_HEIGHT_BDF = 8 # Fixed pixel height for 5x7 BDF font PADDING_BETWEEN_LINES = 1 - # Y positions based on a simple top-down calculation - y_pos_title_top = 1 - y_pos_artist_top = 11 - y_pos_album_top = 19 + # Calculate y positions as percentages of display height for scaling + matrix_height = self.display_manager.matrix.height - TEXT_SCROLL_DIVISOR = 5 + # Define positions as percentages (0.0 to 1.0) + TITLE_Y_PERCENT = 0.03 # 3% from top + ARTIST_Y_PERCENT = 0.34 # 34% from top + ALBUM_Y_PERCENT = 0.59 # 59% from top + + # Calculate actual pixel positions + y_pos_title_top = int(matrix_height * TITLE_Y_PERCENT) + y_pos_artist_top = int(matrix_height * ARTIST_Y_PERCENT) + y_pos_album_top = int(matrix_height * ALBUM_Y_PERCENT) + + TEXT_SCROLL_DIVISOR = 5 # --- Title --- title_width = self.display_manager.get_text_width(title, font_title)