From 949b64f28c8f0f4e7c973c707d2a3ccacf3f81fd Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 27 Apr 2023 18:40:04 +0800 Subject: [PATCH] fixed spacing issues with new date format for league prof --- stockTicker.py | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/stockTicker.py b/stockTicker.py index 76b9108..d27c132 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -3792,14 +3792,32 @@ class StockTicker(): vs_timage = self.textImage('vs', font, r = 255, g = 255, b = 255, h_buff = 5) x_offsetdate2 = x_offset + int((hc_timage.size[0] + vs_timage.size[0] + ac_timage.size[0])/2)- int(date_timage.size[0]/2) - img.paste(date_timage, (x_offsetdate2,0)) - x_offsetdate2 += date_timage.size[0] - img.paste(ac_timage, (x_offset, 5)) - x_offset += ac_timage.size[0] - img.paste(vs_timage, (x_offset, 5)) - x_offset += vs_timage.size[0] - img.paste(hc_timage, (x_offset, 5)) - x_offset += hc_timage.size[0] + + if date_timage.size[0] > (ac_timage.size[0] + vs_timage.size[0] + hc_timage.size[0]): + x_offset3 = x_offset + int(date_timage.size[0]/2) + img.paste(date_timage, (x_offset,0)) + x_offset += date_timage.size[0] + img.paste(ac_timage, (x_offset3 - int(ac_timage.size[0]) - int(vs_timage.size[0]/2), 5)) + img.paste(vs_timage, (x_offset3 - int(vs_timage.size[0]/2), 5)) + img.paste(hc_timage, (x_offset3 + int(vs_timage.size[0]/2), 5)) + else: + img.paste(date_timage, (x_offsetdate2,0)) + x_offsetdate2 += date_timage.size[0] + img.paste(ac_timage, (x_offset, 5)) + x_offset += ac_timage.size[0] + img.paste(vs_timage, (x_offset, 5)) + x_offset += vs_timage.size[0] + img.paste(hc_timage, (x_offset, 5)) + x_offset += hc_timage.size[0] + + #img.paste(date_timage, (x_offsetdate2,0)) + #x_offsetdate2 += date_timage.size[0] + #img.paste(ac_timage, (x_offset, 5)) + #x_offset += ac_timage.size[0] + #img.paste(vs_timage, (x_offset, 5)) + #x_offset += vs_timage.size[0] + #img.paste(hc_timage, (x_offset, 5)) + #x_offset += hc_timage.size[0] #x_offset += max(date_timage.size[0], (hc_timage.size[0] + vs_timage.size[0] + ac_timage.size[0])) else: score_image = self.textImage(intAwayScore + '-' + intHomeScore, font, h_buff = 5, r = 255, g = 255, b = 255)