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)