Skip to content

Commit

Permalink
Fixed GpuMemDumpVis.py to not use deprecated Pillow function textsize
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-sawicki-a committed Nov 3, 2023
1 parent 5cb534c commit 1ab8aae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/GpuMemDumpVis/GpuMemDumpVis.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from PIL import Image, ImageDraw, ImageFont


PROGRAM_VERSION = 'Vulkan/D3D12 Memory Allocator Dump Visualization 3.0.2'
PROGRAM_VERSION = 'Vulkan/D3D12 Memory Allocator Dump Visualization 3.0.3'
IMG_WIDTH = 1200
IMG_MARGIN = 8
TEXT_MARGIN = 4
Expand Down Expand Up @@ -277,8 +277,8 @@ def DrawDedicatedAllocationBlock(draw, y, dedicatedAlloc, pixelsPerByte):
draw.text((x + IMG_MARGIN + TEXT_MARGIN, y), "0", fill=COLOR_TEXT_H2, font=font)
else:
text = BytesToStr(byte)
textSize = draw.textsize(text, font=font)
draw.text((x + IMG_MARGIN - textSize[0] - TEXT_MARGIN, y), text, fill=COLOR_TEXT_H2, font=font)
textLength = draw.textlength(text, font=font)
draw.text((x + IMG_MARGIN - textLength - TEXT_MARGIN, y), text, fill=COLOR_TEXT_H2, font=font)
byte += bytesBetweenGridLines
y += FONT_SIZE + IMG_MARGIN

Expand Down

0 comments on commit 1ab8aae

Please sign in to comment.