From add02b695bb631344742c3752719e3fdc5c6ef7a Mon Sep 17 00:00:00 2001 From: Nishi Date: Sat, 23 May 2026 06:14:37 +0900 Subject: [PATCH] make label respect alignment --- src/widget/label.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/widget/label.c b/src/widget/label.c index 81b0498..5a165e7 100644 --- a/src/widget/label.c +++ b/src/widget/label.c @@ -336,6 +336,7 @@ static void draw_normal(MwWidget handle) { r.width -= MwGetInteger(handle, MwNleftPadding); +#if 0 if(align == MwALIGNMENT_CENTER) { p.x = r.width / 2; } else if(align == MwALIGNMENT_BEGINNING) { @@ -343,17 +344,20 @@ static void draw_normal(MwWidget handle) { } else if(align == MwALIGNMENT_END) { p.x = r.width - MwTextWidth(handle, NULL, str) / 2; } +#else + p.x = 0; +#endif p.y = r.height / 2; p.x += MwGetInteger(handle, MwNleftPadding); p.x += 1; p.y += 1; - MwDrawText(handle, NULL, &p, str, MwALIGNMENT_CENTER, shadow); + MwDrawText(handle, NULL, &p, str, MwALIGNMENT_BEGINNING, shadow); p.x -= 1; p.y -= 1; - MwDrawText(handle, NULL, &p, str, MwALIGNMENT_CENTER, text); + MwDrawText(handle, NULL, &p, str, MwALIGNMENT_BEGINNING, text); MwLLFreeColor(shadow); MwLLFreeColor(text);