1
0
Fork 0
forked from len0rd/rockbox

Fixes text viewer column advance when in wide mode using play+left/right button combo (bug #5685)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10327 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Mark Arigo 2006-07-25 20:49:53 +00:00
parent 85c2bfa3e4
commit 073d73be51

View file

@ -839,19 +839,17 @@ static void viewer_draw(int col)
if (line_width > col) { if (line_width > col) {
str = oldstr = line_begin; str = oldstr = line_begin;
k = col; k = col;
while (k > 0) {
str = crop_at_width(str);
k-=draw_columns;
}
oldstr=line_begin=str;
width = 0; width = 0;
while( (width<draw_columns) && (oldstr<line_end) ) while( (width<draw_columns) && (oldstr<line_end) )
{ {
oldstr = get_ucs(oldstr, &ch); oldstr = get_ucs(oldstr, &ch);
if (k > 0) {
k -= glyph_width(ch);
line_begin = oldstr;
} else {
width += glyph_width(ch); width += glyph_width(ch);
} }
}
if(prefs.view_mode==WIDE) if(prefs.view_mode==WIDE)
endptr = rb->iso_decode(line_begin, utf8_buffer, endptr = rb->iso_decode(line_begin, utf8_buffer,
@ -1355,18 +1353,22 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
#ifdef VIEWER_COLUMN_LEFT #ifdef VIEWER_COLUMN_LEFT
case VIEWER_COLUMN_LEFT: case VIEWER_COLUMN_LEFT:
case VIEWER_COLUMN_LEFT | BUTTON_REPEAT: case VIEWER_COLUMN_LEFT | BUTTON_REPEAT:
if (prefs.view_mode == WIDE) {
/* Scroll left one column */ /* Scroll left one column */
col -= glyph_width('o'); col -= glyph_width('o');
col = col_limit(col); col = col_limit(col);
viewer_draw(col); viewer_draw(col);
}
break; break;
case VIEWER_COLUMN_RIGHT: case VIEWER_COLUMN_RIGHT:
case VIEWER_COLUMN_RIGHT | BUTTON_REPEAT: case VIEWER_COLUMN_RIGHT | BUTTON_REPEAT:
if (prefs.view_mode == WIDE) {
/* Scroll right one column */ /* Scroll right one column */
col += glyph_width('o'); col += glyph_width('o');
col = col_limit(col); col = col_limit(col);
viewer_draw(col); viewer_draw(col);
}
break; break;
#endif #endif