Skip to content

Commit

Permalink
replace pillow getsize
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed Aug 24, 2023
1 parent 41d1cf2 commit ce417e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions nonebot_plugin_wordle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"unique_name": "wordle",
"example": "@小Q 猜单词\nwordle -l 6 -d CET6",
"author": "meetwq <[email protected]>",
"version": "0.3.2",
"version": "0.3.3",
},
)

Expand Down Expand Up @@ -204,7 +204,7 @@ async def send(
except ParserExit as e:
if e.status == 0:
await send(__plugin_meta__.usage)
await send()
return

options = Options(**vars(args))

Expand Down
6 changes: 3 additions & 3 deletions nonebot_plugin_wordle/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def draw_block(self, color: Tuple[int, int, int], letter: str) -> IMG:
if letter:
letter = letter.upper()
draw = ImageDraw.Draw(block)
letter_size = self.font.getsize(letter)
x = (self.block_size[0] - letter_size[0]) / 2
y = (self.block_size[1] - letter_size[1]) / 2
bbox = self.font.getbbox(letter)
x = (self.block_size[0] - bbox[2]) / 2
y = (self.block_size[1] - bbox[3]) / 2
draw.text((x, y), letter, font=self.font, fill=self.font_color)
return block

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot_plugin_wordle"
version = "0.3.2"
version = "0.3.3"
description = "Nonebot2 wordle猜单词插件"
authors = ["meetwq <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit ce417e6

Please sign in to comment.