# HG changeset patch # User ulion # Date 1198077687 0 # Node ID 5779358c3f865007a2b10abd4b96fba8c29f4bfb # Parent 8c4c1abcac50005058276e611f7799c9fc8737ba 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. diff -r 8c4c1abcac50 -r 5779358c3f86 libmenu/menu_list.c --- a/libmenu/menu_list.c Wed Dec 19 09:34:28 2007 +0000 +++ b/libmenu/menu_list.c Wed Dec 19 15:21:27 2007 +0000 @@ -107,16 +107,16 @@ 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));