mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 06:30:06 +00:00
skip lines with negative y position if there is too many lines to display
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1570 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4e876e1d56
commit
dc2db77418
42
libvo/sub.c
42
libvo/sub.c
@ -48,14 +48,16 @@ inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x
|
|||||||
// printf("osd.progbar width=%d xpos=%d\n",width,x);
|
// printf("osd.progbar width=%d xpos=%d\n",width,x);
|
||||||
|
|
||||||
c=vo_osd_progbar_type;
|
c=vo_osd_progbar_type;
|
||||||
if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0)
|
if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0) {
|
||||||
draw_alpha(x-vo_font->width[c]-vo_font->spacewidth,y,
|
int xp=x-vo_font->width[c]-vo_font->spacewidth;
|
||||||
|
draw_alpha((xp<0?0:xp),y,
|
||||||
vo_font->width[c],
|
vo_font->width[c],
|
||||||
vo_font->pic_a[font]->h,
|
vo_font->pic_a[font]->h,
|
||||||
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
||||||
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
||||||
vo_font->pic_a[font]->w);
|
vo_font->pic_a[font]->w);
|
||||||
|
}
|
||||||
|
|
||||||
c=OSD_PB_START;
|
c=OSD_PB_START;
|
||||||
if ((font=vo_font->font[c])>=0)
|
if ((font=vo_font->font[c])>=0)
|
||||||
draw_alpha(x,y,
|
draw_alpha(x,y,
|
||||||
@ -197,24 +199,30 @@ inline static void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,in
|
|||||||
|
|
||||||
k=i=0; l=lines;
|
k=i=0; l=lines;
|
||||||
while (l--){
|
while (l--){
|
||||||
x = xtbl[i++];
|
if (y>=0){
|
||||||
if(y<dys)
|
x= xtbl[i++];
|
||||||
while ((c=utbl[k++])){
|
while ((c=utbl[k++])){
|
||||||
if (x>=0 && x+vo_font->width[c]<=dxs)
|
if (x>=0 && x+vo_font->width[c]<=dxs)
|
||||||
if ((font=vo_font->font[c])>=0)
|
if ((font=vo_font->font[c])>=0)
|
||||||
draw_alpha(x,y,
|
draw_alpha(x,y,
|
||||||
vo_font->width[c],
|
vo_font->width[c],
|
||||||
// vo_font->pic_a[font]->h,
|
// vo_font->pic_a[font]->h,
|
||||||
(y+vo_font->pic_a[font]->h<=dys)?vo_font->pic_a[font]->h:dys-y,
|
(y+vo_font->pic_a[font]->h<=dys)?vo_font->pic_a[font]->h:dys-y,
|
||||||
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
||||||
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
||||||
vo_font->pic_a[font]->w);
|
vo_font->pic_a[font]->w);
|
||||||
x+=vo_font->width[c]+vo_font->charspace;
|
x+=vo_font->width[c]+vo_font->charspace;
|
||||||
}
|
}
|
||||||
y+=vo_font->height;
|
} else {
|
||||||
|
while (utbl[k++]) ; // skip lines with negative y value
|
||||||
|
i++; // seldom case but who know ;-)
|
||||||
|
}
|
||||||
|
y+=vo_font->height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int draw_alpha_init_flag=0;
|
static int draw_alpha_init_flag=0;
|
||||||
|
|
||||||
extern void vo_draw_alpha_init();
|
extern void vo_draw_alpha_init();
|
||||||
|
Loading…
Reference in New Issue
Block a user