mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-21 20:20:05 +08:00
refactor(zhenxun/utils): 优化代码类型注释和参数类型
- 在 text_size 方法中,将 text 参数类型从 str 改为任意类型,以适应更多输入 - 在 resize 方法中,将 width 和 height 参数类型从 int 改为 float,增加灵活性 - 优化部分代码的类型注释,提高代码可读性和维护性
This commit is contained in:
@@ -232,8 +232,8 @@ class ImageTemplate:
|
||||
async def __build_text_image(
|
||||
cls,
|
||||
text: str,
|
||||
width: int,
|
||||
height: int,
|
||||
width: float,
|
||||
height: float,
|
||||
font: FreeTypeFont,
|
||||
font_color: str | tuple[int, int, int] = (0, 0, 0),
|
||||
color: str | tuple[int, int, int] = (255, 255, 255),
|
||||
|
||||
Reference in New Issue
Block a user