mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 10:02:17 +00:00
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25463 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5fdfc9124d
commit
d7ed78143c
@ -107,16 +107,16 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) {
|
||||
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user