refactor(zhenxun/utils): 优化代码类型注释和参数类型

- 在 text_size 方法中,将 text 参数类型从 str 改为任意类型,以适应更多输入
- 在 resize 方法中,将 width 和 height 参数类型从 int 改为 float,增加灵活性
- 优化部分代码的类型注释,提高代码可读性和维护性
This commit is contained in:
molanp
2025-08-08 01:20:10 +08:00
parent 86c1165c12
commit 59507711e8
4 changed files with 43 additions and 53 deletions
+2 -2
View File
@@ -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),