From 3d9ee2631ce40584a24f247c5c92bacab849c8e9 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Sat, 28 Jun 2025 22:45:41 +0800 Subject: [PATCH] fix leap month display --- GUI/GUI.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GUI/GUI.c b/GUI/GUI.c index e21fa3d..0b8053a 100644 --- a/GUI/GUI.c +++ b/GUI/GUI.c @@ -179,9 +179,9 @@ static void DrawDateHeader(Adafruit_GFX *gfx, int16_t x, int16_t y, tm_t *tm, st GFX_setFont(gfx, u8g2_font_wqy9_t_lunar); GFX_printf(gfx, "星期%s", Lunar_DayString[tm->tm_wday]); - DrawBattery(gfx, 365, 6, data->voltage); + DrawBattery(gfx, 366, 6, data->voltage); - GFX_setCursor(gfx, x + 270, y); + GFX_setCursor(gfx, x + (Lunar->IsLeap ? 266 : 272), y); GFX_printf(gfx, "%s%s%s %s%s", Lunar_MonthLeapString[Lunar->IsLeap], Lunar_MonthString[Lunar->Month], Lunar_DateString[Lunar->Date], Lunar_StemStrig[LUNAR_GetStem(Lunar)], Lunar_BranchStrig[LUNAR_GetBranch(Lunar)]);