From e9fd2705d4c34a3c42b0307d718b915a881633b6 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 21 Dec 2025 23:05:42 +0900 Subject: [PATCH] fix --- src/widget/button.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/widget/button.c b/src/widget/button.c index 8db12c3..885ff9d 100644 --- a/src/widget/button.c +++ b/src/widget/button.c @@ -20,6 +20,7 @@ static void draw(MwWidget handle) { const char* str = MwGetText(handle, MwNtext); MwLLPixmap px = MwGetVoid(handle, MwNpixmap); MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); + int inv; if(str == NULL) str = ""; @@ -29,8 +30,6 @@ static void draw(MwWidget handle) { r.height = MwGetInteger(handle, MwNheight); if(MwGetInteger(handle, MwNflat)) { - int inv; - if(handle->pressed || ((inv = MwGetInteger(handle, MwNforceInverted)) != MwDEFAULT && inv)) { MwDrawWidgetBack(handle, &r, base, handle->pressed, 1); } else { @@ -40,7 +39,7 @@ static void draw(MwWidget handle) { MwDrawWidgetBack(handle, &r, base, handle->pressed, 1); } if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); - if(MwGetInteger(handle, MwNflat) && !handle->pressed) { + if(MwGetInteger(handle, MwNflat) && !(handle->pressed || ((inv = MwGetInteger(handle, MwNforceInverted)) != MwDEFAULT && inv))) { r.x += MwDefaultBorderWidth(handle); r.y += MwDefaultBorderWidth(handle); r.width -= MwDefaultBorderWidth(handle) * 2;