Skip to content

Commit

Permalink
fix: Replace deprecated method in camera parser (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
FFrost authored Jul 1, 2024
1 parent 0073162 commit d3f82d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rustplus/api/remote/camera/camera_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit d3f82d4

Please sign in to comment.