Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 575567ba0a48764d01d7f65365894ac97411d633 1 parent 5b7ad1f
kugel authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 apps/playlist_viewer.c
View
8 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)
{

0 comments on commit 575567b

Please sign in to comment.
Something went wrong with that request. Please try again.