🧹 More refactoring

This commit is contained in:
Nikolaj
2021-08-17 18:05:41 +02:00
parent 074a06e863
commit 573d081734
31 changed files with 1971 additions and 1787 deletions

View File

@ -38,10 +38,10 @@ class NerdShit():
heights += [height]
width = max(width,int(pod.img['@width']))
if titleChucks[x][count] == "":
placeForText = 0
placeFor_text = 0
else:
placeForText = 30
height += int(pod.img["@height"]) + 10 + placeForText
placeFor_text = 30
height += int(pod.img["@height"]) + 10 + placeFor_text
width += 10
height += 5
@ -55,18 +55,18 @@ class NerdShit():
old_image = Image.open("gwendolyn/resources/wolfTemp.png")
oldSize = old_image.size
if titleChucks[x][count] == "":
placeForText = 0
placeFor_text = 0
else:
placeForText = 30
newSize = (width,int(oldSize[1]+10+placeForText))
newImage = Image.new("RGB",newSize,color=(255,255,255))
newImage.paste(old_image, (int((int(oldSize[0]+10)-oldSize[0])/2),int(((newSize[1]-placeForText)-oldSize[1])/2)+placeForText))
placeFor_text = 30
newSize = (width,int(oldSize[1]+10+placeFor_text))
new_image = Image.new("RGB",newSize,color=(255,255,255))
new_image.paste(old_image, (int((int(oldSize[0]+10)-oldSize[0])/2),int(((newSize[1]-placeFor_text)-oldSize[1])/2)+placeFor_text))
if titleChucks[x][count] != "":
d = ImageDraw.Draw(newImage,"RGB")
d = ImageDraw.Draw(new_image,"RGB")
d.text((5,7),titleChucks[x][count],font=fnt,fill=(150,150,150))
wolfImage.paste(newImage,(0,heights[count]))
newImage.close()
wolfImage.paste(new_image,(0,heights[count]))
new_image.close()
old_image.close()
count += 1