From d3f82d4850d087feb5f72da70a9c799658a2e2b2 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 1 Jul 2024 16:09:33 -0400 Subject: [PATCH] fix: Replace deprecated method in camera parser (#69) --- rustplus/api/remote/camera/camera_parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rustplus/api/remote/camera/camera_parser.py b/rustplus/api/remote/camera/camera_parser.py index c084e9f..6fde4cf 100644 --- a/rustplus/api/remote/camera/camera_parser.py +++ b/rustplus/api/remote/camera/camera_parser.py @@ -393,11 +393,12 @@ def handle_entity( # The font size should be proportional to the size of the entity as it gets further away with resources.path(FONT_PATH, "PermanentMarker.ttf") as path: font = ImageFont.truetype(str(path), font_size) - size = image_draw.textsize(entity.name, font=font) + width = image_draw.textlength(entity.name, font=font) + height = font_size name_place1 = ( - name_place[0] - size[0] // 2, - name_place[1] - size[1] // 2, + name_place[0] - width // 2, + name_place[1] - height // 2, ) text.add((name_place1, entity.name, font))