From ffda1a42d9d3108bae4a5673c5a32aa239f3b352 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sat, 20 Apr 2013 16:25:26 +0200 Subject: [PATCH] Added rounding to the percent of page in status bar. If the user scrolled to 1% of the page there was 0% shown and with 50G vimb browser showed 49% in status bar. This patch adapts the rounding of the values in the status bar so that they fit to the done scrolling. --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index cb0e14a..caca584 100644 --- a/src/main.c +++ b/src/main.c @@ -18,6 +18,7 @@ */ #include +#include #include "main.h" #include "util.h" #include "command.h" @@ -306,7 +307,7 @@ void vb_update_statusbar() /* show the scroll status */ max = gtk_adjustment_get_upper(vb.gui.adjust_v) - gtk_adjustment_get_page_size(vb.gui.adjust_v); - val = (int)(gtk_adjustment_get_value(vb.gui.adjust_v) / max * 100); + val = (int)floor(0.5 + (gtk_adjustment_get_value(vb.gui.adjust_v) / max * 100)); if (max == 0) { g_string_append(status, " All"); -- 2.20.1