Browse Source

cea708: fix CEA708_Window_Truncate()

Make truncation actually drop one column in LTR/RTL (adjust
lastcol/firstcol; delete rows only when they become empty).

Fixes #29328
pull/192/head
Stanislav Fort 5 months ago
committed by Thomas Guillem
parent
commit
c86e89101c
  1. 16
      modules/codec/cea708.c

16
modules/codec/cea708.c

@ -605,6 +605,8 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
for( int i=p_w->i_firstrow; i <= p_w->i_lastrow; i++ )
{
cea708_text_row_t *row = p_w->rows[i];
if (!row)
continue;
if( row->lastcol == i_max )
{
if( row->firstcol >= row->lastcol )
@ -616,6 +618,12 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
else if( i == p_w->i_lastrow )
p_w->i_lastrow--;
}
else
{
/* Drop rightmost column */
row->lastcol--;
}
}
}
}
@ -626,6 +634,8 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
for( int i=p_w->i_firstrow; i <= p_w->i_lastrow; i++ )
{
cea708_text_row_t *row = p_w->rows[i];
if (!row)
continue;
if( row->firstcol == i_min )
{
if( row->firstcol >= row->lastcol )
@ -637,6 +647,12 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
else if( i == p_w->i_lastrow )
p_w->i_lastrow--;
}
else
{
/* Drop leftmost column */
row->firstcol++;
}
}
}
}

Loading…
Cancel
Save