Playlist viewer: Fix off-by-one when moving tracks caused by r28131.
The callbacks for the list code need the current item for rendering the moving track, which is not known until after the first draw. Hence the first draw is off. A second one is needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28199 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2ddcd7fd94
commit
c4925f14a3
1 changed files with 5 additions and 3 deletions
|
@ -654,17 +654,19 @@ enum playlist_viewer_result playlist_viewer_ex(const char* filename)
|
|||
/* Timeout so we can determine if play status has changed */
|
||||
bool res = list_do_action(CONTEXT_LIST, HZ/2,
|
||||
&playlist_lists, &button, LIST_WRAP_UNLESS_HELD);
|
||||
/* during moving, another redraw is going to be needed,
|
||||
* since viewer.selected_track is updated too late (after the first draw)
|
||||
* drawing the moving item needs it */
|
||||
viewer.selected_track=gui_synclist_get_sel_pos(&playlist_lists);
|
||||
if (res)
|
||||
{
|
||||
bool reload = playlist_buffer_needs_reload(&viewer.buffer,
|
||||
viewer.selected_track);
|
||||
if(reload)
|
||||
{
|
||||
if (reload)
|
||||
playlist_buffer_load_entries_screen(&viewer.buffer,
|
||||
button == ACTION_STD_NEXT ? FORWARD : BACKWARD);
|
||||
if (reload || viewer.moving_track >= 0)
|
||||
gui_synclist_draw(&playlist_lists);
|
||||
}
|
||||
}
|
||||
switch (button)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue