placement as % of matrix height

This commit is contained in:
ChuckBuilds
2025-07-24 20:47:20 -05:00
parent bfa1234feb
commit 74036ed6d9

View File

@@ -757,10 +757,18 @@ class MusicManager:
LINE_HEIGHT_BDF = 8 # Fixed pixel height for 5x7 BDF font LINE_HEIGHT_BDF = 8 # Fixed pixel height for 5x7 BDF font
PADDING_BETWEEN_LINES = 1 PADDING_BETWEEN_LINES = 1
# Y positions based on a simple top-down calculation # Calculate y positions as percentages of display height for scaling
y_pos_title_top = 1 matrix_height = self.display_manager.matrix.height
y_pos_artist_top = 11
y_pos_album_top = 19 # 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 TEXT_SCROLL_DIVISOR = 5