[MPlayer-cvslog] r25463 - trunk/libmenu/menu_list.c

ulion subversion at mplayerhq.hu
Wed Dec 19 16:21:27 CET 2007


Author: ulion
Date: Wed Dec 19 16:21:27 2007
New Revision: 25463

Log:
Currently menu title did not align center together with menu items when x>=0.
Now fix it to get a good alignment with menu items.


Modified:
   trunk/libmenu/menu_list.c

Modified: trunk/libmenu/menu_list.c
==============================================================================
--- trunk/libmenu/menu_list.c	(original)
+++ trunk/libmenu/menu_list.c	Wed Dec 19 16:21:27 2007
@@ -107,16 +107,16 @@ void menu_list_draw(menu_t* menu,mp_imag
 
   bg_w = need_w+2*mpriv->minb;
   if(th > 0) {
+    int tw,th2;
+    menu_text_size(mpriv->title,dw,mpriv->vspace,1,&tw,&th2);
     if(mpriv->title_bg >= 0) {
-      int tw,th2;
-      menu_text_size(mpriv->title,dw,mpriv->vspace,1,&tw,&th2);
       if(tw+2*mpriv->minb > bg_w) bg_w = tw+2*mpriv->minb;
       menu_draw_box(mpi,mpriv->title_bg,mpriv->title_bg_alpha,
                     x < 0 ? (mpi->w-bg_w)/2 : x-mpriv->minb,dy+y-mpriv->vspace/2,bg_w,th);
     }
     menu_draw_text_full(mpi,mpriv->title,
 			x < 0 ? mpi->w / 2 : x,
-			dy+y,dw,0,
+			dy+y, x < 0 ? dw : (tw > need_w ? tw : need_w), 0,
 			mpriv->vspace,1,
 			MENU_TEXT_TOP|MENU_TEXT_HCENTER,
 			MENU_TEXT_TOP|(x < 0 ? MENU_TEXT_HCENTER :MENU_TEXT_LEFT));



More information about the MPlayer-cvslog mailing list