From 33b4333b7671f5452dad91fc0ec18f9e0b004284 Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 20 Sep 2023 15:18:32 +0800 Subject: [PATCH] decreased width for clock 1 prof --- stockTicker.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/stockTicker.py b/stockTicker.py index 4649543..e1f6651 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -1229,11 +1229,11 @@ class StockTicker(): date_width, date_height = draw.textsize(date_t, font_2) wday_width, wday_height = draw.textsize(weekday_t, font_2) text_width, text_height = draw.textsize(time_t, font_1) - total_width = text_width + 6 + max(wday_width, date_width) + total_width = text_width + 5 + max(wday_width, date_width) starting_coord = (128-total_width)/2 draw.text((starting_coord, 1), time_t, time_colors1[time_color2], font_1) - draw.text((starting_coord + text_width + 6, 1), date_t, time_colors1[date_color2], font_2) - draw.text((starting_coord + text_width + 7, 8), weekday_t, time_colors1[weekday_color2], font_2) + draw.text((starting_coord + text_width + 5, 1), date_t, time_colors1[date_color2], font_2) + draw.text((starting_coord + text_width + 6, 8), weekday_t, time_colors1[weekday_color2], font_2) #If time now is greater than 1 second of the previously updated image time, update image and reset updated image time to another second if time.time() >= the_time + 1: the_time = time.time() @@ -1245,11 +1245,11 @@ class StockTicker(): date_width, date_height = draw.textsize(date_t, font_2) wday_width, wday_height = draw.textsize(weekday_t, font_2) text_width, text_height = draw.textsize(time_t, font_1) - total_width = text_width + 6 + max(wday_width, date_width) + total_width = text_width + 5 + max(wday_width, date_width) starting_coord = (128-total_width)/2 draw.text((starting_coord, 1), time_t, time_colors1[time_color2], font_1) - draw.text((starting_coord + text_width + 6, 1), date_t, time_colors1[date_color2], font_2) - draw.text((starting_coord + text_width + 7, 8), weekday_t, time_colors1[weekday_color2], font_2) + draw.text((starting_coord + text_width + 5, 1), date_t, time_colors1[date_color2], font_2) + draw.text((starting_coord + text_width + 6, 8), weekday_t, time_colors1[weekday_color2], font_2) if time.time() - update_t1 > delay_t1: update_t1 = time.time() #Get the pause time right before image is done transitioning in @@ -1459,11 +1459,11 @@ class StockTicker(): date_width_b, date_height_b = draw2.textsize(date_t_b, font_2_b) wday_width_b, wday_height_b = draw2.textsize(weekday_t_b, font_2_b) text_width_b, text_height_b = draw2.textsize(time_t_b, font_1_b) - total_width_b = text_width_b + 6 + max(wday_width_b, date_width_b) + total_width_b = text_width_b + 5 + max(wday_width_b, date_width_b) starting_coord_b = (128-total_width_b)/2 draw2.text((starting_coord_b, 1), time_t_b, time_colors1[time_color2_b], font_1_b) - draw2.text((starting_coord_b + text_width_b + 6, 1), date_t_b, time_colors1[date_color2_b], font_2_b) - draw2.text((starting_coord_b + text_width_b + 7, 8), weekday_t_b, time_colors1[weekday_color2_b], font_2_b) + draw2.text((starting_coord_b + text_width_b + 5, 1), date_t_b, time_colors1[date_color2_b], font_2_b) + draw2.text((starting_coord_b + text_width_b + 6, 8), weekday_t_b, time_colors1[weekday_color2_b], font_2_b) #If time now is greater than 1 second of the previously updated image time, update image and reset updated image time to another second if time.time() >= the_time2 + 1: the_time2 = time.time() @@ -1475,11 +1475,11 @@ class StockTicker(): date_width_b, date_height_b = draw2.textsize(date_t_b, font_2_b) wday_width_b, wday_height_b = draw2.textsize(weekday_t_b, font_2_b) text_width_b, text_height_b = draw2.textsize(time_t_b, font_1_b) - total_width_b = text_width_b + 6 + max(wday_width_b, date_width_b) + total_width_b = text_width_b + 5 + max(wday_width_b, date_width_b) starting_coord_b = (128-total_width_b)/2 draw2.text((starting_coord_b, 1), time_t_b, time_colors1[time_color2_b], font_1_b) - draw2.text((starting_coord_b + text_width_b + 6, 1), date_t_b, time_colors1[date_color2_b], font_2_b) - draw2.text((starting_coord_b + text_width_b + 7, 8), weekday_t_b, time_colors1[weekday_color2_b], font_2_b) + draw2.text((starting_coord_b + text_width_b + 5, 1), date_t_b, time_colors1[date_color2_b], font_2_b) + draw2.text((starting_coord_b + text_width_b + 6, 8), weekday_t_b, time_colors1[weekday_color2_b], font_2_b) if time.time() - update_t2 > delay_t2: update_t2 = time.time() #Get the pause time right before image is done transitioning in