From 087eed8592e7614cfb0ad97ac8a2f11e44a4f51b Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 29 Feb 2016 16:23:33 +0100 Subject: [PATCH] Improve sidebar behaviour --- source/godmode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/godmode.c b/source/godmode.c index 8096cab..1a69d14 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -86,7 +86,7 @@ void DrawDirContents(DirStruct* contents, u32 cursor) { u32 bar_height = (lines * SCREEN_HEIGHT) / contents->n_entries; if (bar_height < bar_height_min) bar_height = bar_height_min; - u32 bar_pos = (((u64) cursor * (SCREEN_HEIGHT - bar_height)) / contents->n_entries); + u32 bar_pos = ((u64) offset_disp * (SCREEN_HEIGHT - bar_height)) / (contents->n_entries - lines); DrawRectangleF(false, SCREEN_WIDTH_BOT - bar_width, 0, bar_width, bar_pos, COLOR_STD_BG); DrawRectangleF(false, SCREEN_WIDTH_BOT - bar_width, bar_pos + bar_height, bar_width, SCREEN_WIDTH_BOT - (bar_pos + bar_height), COLOR_STD_BG);