label need to redraw the background first.

origin
stpohle 21 years ago
parent 7fcdade43c
commit 546811c439

@ -1,4 +1,4 @@
/* $Id: menulabels.c,v 1.6 2004/05/25 22:22:29 stpohle Exp $ /* $Id: menulabels.c,v 1.7 2004/09/12 16:49:48 stpohle Exp $
* Menuhandling: labels */ * Menuhandling: labels */
#include "basic.h" #include "basic.h"
@ -15,10 +15,19 @@
void menu_draw_label (_menuitem *mi) { void menu_draw_label (_menuitem *mi) {
int dx, dy; int dx, dy;
_menu *menu = (_menu *)mi->menu; _menu *menu = (_menu *)mi->menu;
SDL_Rect rect;
if (mi->type != MENU_label) if (mi->type != MENU_label)
return; return;
/* redraw background */
rect.x = mi->pos.x;
rect.y = mi->pos.y;
rect.w = font[mi->pos.w].size.x * strlen (mi->label);
rect.h = font[mi->pos.w].size.y;
menu_draw_background (menu, &rect);
if (mi->pos.x == -1) if (mi->pos.x == -1)
dx = (menu->oldscreenpos.w - 2*menuimages[0]->w - (strlen (mi->label) * font[mi->pos.w].size.x)) / 2; dx = (menu->oldscreenpos.w - 2*menuimages[0]->w - (strlen (mi->label) * font[mi->pos.w].size.x)) / 2;
else else

Loading…
Cancel
Save