From 295a2a6fa336906cfc233907cebeabf6b8ce9012 Mon Sep 17 00:00:00 2001 From: yuquanjun Date: Thu, 10 Sep 2026 10:46:11 +0800 Subject: [PATCH] Fix song-name trailing ghost by clearing the full text row before redraw. When switching from a longer title to a shorter one, the old gradient-only clear left uncovered glyph fragments outside the pill bounds. Co-authored-by: Cursor --- UI/UI_global.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/UI/UI_global.c b/UI/UI_global.c index 82390d7..59df327 100644 --- a/UI/UI_global.c +++ b/UI/UI_global.c @@ -522,6 +522,15 @@ void show_Param(const LEBEL_UI *UI, GUI_SWITCH *Group) UI_GetFocusGrad(GUI_MODE_PARAM, &c_top, &c_bot); + x1 = (uint16_t)(UI->x + 10); + x2 = (uint16_t)(UI->x + UI->w - 10); + + /* 修复曲目名尾部残留:旧名比新名长时,只填渐变胶囊(x+25 ~ x+w-40) + 盖不住文字区(x+10 ~ x+w-10)内的旧笔画,切到短名后尾部留残影。 + 先按行底色清整个文字区,再补渐变与文字;整行清除会盖住两侧三角, + 文字绘制后统一补画。 */ + LCD_FillByColor(x1, row_y, x2, (uint16_t)(row_y + row_h), c_top); + LCD_FillRoundRectGradient( UI->x+25, row_y, UI->x + UI->w-40-(UI->x+25), @@ -536,10 +545,15 @@ void show_Param(const LEBEL_UI *UI, GUI_SWITCH *Group) strcpy(Textstr_new, LocalSongNameGbk[Group->Current]); else GET_ParamNum_Str(Group->Current, 0, Textstr_new, Group->Id); - x1 = (uint16_t)(UI->x + 10); - x2 = (uint16_t)(UI->x + UI->w - 10); UI_DrawIndexedName_Mixed(x1, x2, text_y, NumBuf, Textstr_new, WHITE, BLACK, UI->Text_size); + + /* 补画左右三角(几何与 label_ModeSelece_ui 一致) */ + { + uint16_t row_cy = (uint16_t)(row_y + row_h / 2); + UI_DrawTriLeft((uint16_t)(UI->x + 5), row_cy); + UI_DrawTriRight((uint16_t)(UI->x + UI->w - 5 - UI0902_TRI_R_W), row_cy); + } } @@ -867,12 +881,8 @@ void label_ModeSelece_ui(const LEBEL_UI *UI,GUI_SWITCH * Group) paramCurData = &ParamGuiData[SONG_MODE_PARAM]; } + /* 左右三角由 show_Param 末尾统一补画(整行清除后必须重画) */ show_Param(&UI_Label[GUI_MODE_PARAM], paramCurData); - { - uint16_t row_cy = UI->y + UI0902_TAB_H + 4 + (UI->h - UI0902_TAB_H - 4) / 2; - UI_DrawTriLeft(UI->x + 5, row_cy); - UI_DrawTriRight((uint16_t)(UI->x + UI->w - 5 - UI0902_TRI_R_W), row_cy); - } } void label_TimbreSelece_ui(const LEBEL_UI *UI, GUI_SWITCH * Group)