From e8fad60a103760c8c6bc83ceede5a0a26ab3c6ca Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sat, 24 Nov 2018 13:22:31 +0900 Subject: [PATCH] button: icon buttons should also shift when pressed --- lib/button.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/button.c b/lib/button.c index b4cc2a28..f5fd945d 100644 --- a/lib/button.c +++ b/lib/button.c @@ -67,8 +67,8 @@ void ttk_button_draw(gfx_context_t * ctx, struct TTKButton * button) { draw_sdf_string(ctx, button->x + centered + (button->hilight == 2), button->y + centered_y + (button->hilight == 2), button->title, 16, rgb(0,0,0), SDF_FONT_THIN); } else { sprite_t * icon = icon_get_16(button->title+1); - int centered = button->x + (button->width - icon->width) / 2; - int centered_y = button->y + (button->height - icon->height) / 2; + int centered = button->x + (button->width - icon->width) / 2 + (button->hilight == 2); + int centered_y = button->y + (button->height - icon->height) / 2 + (button->hilight == 2); draw_sprite(ctx, icon, centered, centered_y); }