Skip to content

Commit

Permalink
Merge pull request #2956 from vegatripy/patch-1
Browse files Browse the repository at this point in the history
Update mini_pitft_stats.py to use getbbox() instead of getsize()
  • Loading branch information
dhalbert authored Feb 4, 2025
2 parents 2909bef + 9e1eaba commit b20191b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Pi_Hole_Ad_Blocker/mini_pitft_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,26 @@
y = top
if not buttonA.value: # just button A pressed
draw.text((x, y), IP, font=font, fill="#FFFF00")
y += font.getsize(IP)[1]
y += font.getbbox(IP)[3]
draw.text((x, y), CPU, font=font, fill="#FFFF00")
y += font.getsize(CPU)[1]
y += font.getbbox(CPU)[3]
draw.text((x, y), MemUsage, font=font, fill="#00FF00")
y += font.getsize(MemUsage)[1]
y += font.getbbox(MemUsage)[3]
draw.text((x, y), Disk, font=font, fill="#0000FF")
y += font.getsize(Disk)[1]
y += font.getbbox(Disk)[3]
draw.text((x, y), Temp, font=font, fill="#FF00FF")
y += font.getsize(Temp)[1]
y += font.getbbox(Temp)[3]
else:
draw.text((x, y), IP, font=font, fill="#FFFF00")
y += font.getsize(IP)[1]
y += font.getbbox(IP)[3]
draw.text((x, y), HOST, font=font, fill="#FFFF00")
y += font.getsize(HOST)[1]
y += font.getbbox(HOST)[3]
draw.text((x, y), "Ads Blocked: {}".format(str(ADSBLOCKED)), font=font, fill="#00FF00")
y += font.getsize(str(ADSBLOCKED))[1]
y += font.getbbox(str(ADSBLOCKED))[3]
draw.text((x, y), "Clients: {}".format(str(CLIENTS)), font=font, fill="#0000FF")
y += font.getsize(str(CLIENTS))[1]
y += font.getbbox(str(CLIENTS))[3]
draw.text((x, y), "DNS Queries: {}".format(str(DNSQUERIES)), font=font, fill="#FF00FF")
y += font.getsize(str(DNSQUERIES))[1]
y += font.getbbox(str(DNSQUERIES))[3]

# Display image.
disp.image(image, rotation)
Expand Down

0 comments on commit b20191b

Please sign in to comment.