summaryrefslogtreecommitdiffstats
path: root/apps/playlist_viewer.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-10-02 20:15:35 +0000
committerThomas Martitz <kugel@rockbox.org>2010-10-02 20:15:35 +0000
commitc4925f14a365de30fd4b5610466b5d87693e67fe (patch)
tree503936431c7b69c7cb1fd1e43bf6ca8309785502 /apps/playlist_viewer.c
parent2ddcd7fd94466e742d0284a28ac38a2e072584ce (diff)
downloadrockbox-c4925f14a365de30fd4b5610466b5d87693e67fe.tar.gz
rockbox-c4925f14a365de30fd4b5610466b5d87693e67fe.tar.bz2
rockbox-c4925f14a365de30fd4b5610466b5d87693e67fe.zip
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
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r--apps/playlist_viewer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index c818bafdf9..bd39a385f2 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -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)
{