From 0e0b10f18374497481ca6a5c0fa464e88ca5cc8a Mon Sep 17 00:00:00 2001 From: qwerdvd <2450899274@qq.com> Date: Sat, 6 May 2023 18:41:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=E4=BF=AE=E5=A4=8D=E4=B8=8A?= =?UTF-8?q?=E6=9C=88=E6=9C=88=E5=8E=86=E8=AF=BB=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StarRailUID/starrailuid_note/draw_note_card.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/StarRailUID/starrailuid_note/draw_note_card.py b/StarRailUID/starrailuid_note/draw_note_card.py index b8b74d6..428ca8f 100644 --- a/StarRailUID/starrailuid_note/draw_note_card.py +++ b/StarRailUID/starrailuid_note/draw_note_card.py @@ -202,14 +202,13 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]: fill=black_color, anchor='lm', ) - + xy = ((0, 0), (2100, 2100)) + temp = -90 if not data['month_data']['group_by']: for index, action in enumerate(COLOR_MAP): if action == '其他': continue else: - xy = ((0, 0), (2100, 2100)) - temp = -90 pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0)) pie_image_draw = ImageDraw.Draw(pie_image) for index, i in enumerate(data['month_data']['group_by']): @@ -230,11 +229,11 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]: img.paste(result_pie, (138, 618), result_pie) if last_monthly_data: - xy = ((0, 0), (2100, 2100)) - temp = -90 pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0)) pie_image_draw = ImageDraw.Draw(pie_image) - for index, i in enumerate(data['month_data']['group_by']): + for index, i in enumerate( + last_monthly_data['data']['month_data']['group_by'] + ): pie_image_draw.pieslice( xy, temp, @@ -243,7 +242,6 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]: ) temp = temp + (i['percent'] / 100) * 360 else: - xy = ((0, 0), (2100, 2100)) pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0)) pie_image_draw = ImageDraw.Draw(pie_image) pie_image_draw.ellipse(xy, fill=(128, 128, 128))