From dc8a3fb0f24b5afe42b95a58b49ff9d9f4204f2e Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Mon, 30 Oct 2023 18:27:40 +0100 Subject: [PATCH] Fixed GpuMemDumpVis.py to not use deprecated Pillow function textsize See #375 Thanks @alecazam --- tools/GpuMemDumpVis/GpuMemDumpVis.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/GpuMemDumpVis/GpuMemDumpVis.py b/tools/GpuMemDumpVis/GpuMemDumpVis.py index e0575c1..e27b4cd 100644 --- a/tools/GpuMemDumpVis/GpuMemDumpVis.py +++ b/tools/GpuMemDumpVis/GpuMemDumpVis.py @@ -25,7 +25,7 @@ import json 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 @@ -277,8 +277,8 @@ if __name__ == '__main__': 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