summaryrefslogtreecommitdiff
path: root/apps/gui/bitmap/list.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-04-07 06:59:23 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-04-07 11:02:00 +0000
commit8b56476a2c4125e6deda36edff179f92972b7bb3 (patch)
treef70633ddfe02de4fadc0aaa3206a1883ff3e54aa /apps/gui/bitmap/list.c
parent28c89386af8ea9d002bcc25483233053fe0e7525 (diff)
downloadrockbox-8b56476a2c4125e6deda36edff179f92972b7bb3.tar.gz
rockbox-8b56476a2c4125e6deda36edff179f92972b7bb3.zip
list: After drawing scrollbars, explcitly switch back to old viewport.
The viewport used for the scrollbar is allocated on the stack, and falls out of scope before the next call to set_viewport(), which sets a flag in the now-out-of-scope "last" viewport. Change-Id: I2c8bfcff500d189fa3857411aadc2e16aa545d2c
Diffstat (limited to 'apps/gui/bitmap/list.c')
-rw-r--r--apps/gui/bitmap/list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index aeaceb2780..6f6a8c1f7f 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -203,11 +203,12 @@ void list_draw(struct screen *display, struct gui_synclist *list)
203 vp.x += list_text_vp->width; 203 vp.x += list_text_vp->width;
204 else /* left */ 204 else /* left */
205 list_text_vp->x += SCROLLBAR_WIDTH; 205 list_text_vp->x += SCROLLBAR_WIDTH;
206 display->set_viewport(&vp); 206 struct viewport *last = display->set_viewport(&vp);
207 gui_scrollbar_draw(display, 207 gui_scrollbar_draw(display,
208 (scrollbar_in_left? 0: 1), 0, SCROLLBAR_WIDTH-1, vp.height, 208 (scrollbar_in_left? 0: 1), 0, SCROLLBAR_WIDTH-1, vp.height,
209 list->nb_items, list_start_item, list_start_item + nb_lines, 209 list->nb_items, list_start_item, list_start_item + nb_lines,
210 VERTICAL); 210 VERTICAL);
211 display->set_viewport(last);
211 } 212 }
212 /* shift everything a bit in relation to the title */ 213 /* shift everything a bit in relation to the title */
213 else if (!VP_IS_RTL(list_text_vp) && scrollbar_in_left) 214 else if (!VP_IS_RTL(list_text_vp) && scrollbar_in_left)