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,18 +654,20 @@ enum playlist_viewer_result playlist_viewer_ex(const char* filename)
|
||||||
/* Timeout so we can determine if play status has changed */
|
/* Timeout so we can determine if play status has changed */
|
||||||
bool res = list_do_action(CONTEXT_LIST, HZ/2,
|
bool res = list_do_action(CONTEXT_LIST, HZ/2,
|
||||||
&playlist_lists, &button, LIST_WRAP_UNLESS_HELD);
|
&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);
|
viewer.selected_track=gui_synclist_get_sel_pos(&playlist_lists);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
bool reload = playlist_buffer_needs_reload(&viewer.buffer,
|
bool reload = playlist_buffer_needs_reload(&viewer.buffer,
|
||||||
viewer.selected_track);
|
viewer.selected_track);
|
||||||
if (reload)
|
if (reload)
|
||||||
{
|
|
||||||
playlist_buffer_load_entries_screen(&viewer.buffer,
|
playlist_buffer_load_entries_screen(&viewer.buffer,
|
||||||
button == ACTION_STD_NEXT ? FORWARD : BACKWARD);
|
button == ACTION_STD_NEXT ? FORWARD : BACKWARD);
|
||||||
|
if (reload || viewer.moving_track >= 0)
|
||||||
gui_synclist_draw(&playlist_lists);
|
gui_synclist_draw(&playlist_lists);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
switch (button)
|
switch (button)
|
||||||
{
|
{
|
||||||
case ACTION_TREE_WPS:
|
case ACTION_TREE_WPS:
|
||||||
|
|
Loading…
Reference in a new issue