[gnome-control-center] Always round up the CcStrengthBar rather than down
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Always round up the CcStrengthBar rather than down
- Date: Wed, 4 Apr 2012 13:38:34 +0000 (UTC)
commit 9eb047baff69f78273e0be20c42c06cde7a2e27f
Author: Richard Hughes <richard hughsie com>
Date: Mon Mar 26 17:48:23 2012 +0100
Always round up the CcStrengthBar rather than down
It's a measure of completeness, not of progress.
shell/cc-strength-bar.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/shell/cc-strength-bar.c b/shell/cc-strength-bar.c
index 1b9b4aa..ed1f28e 100644
--- a/shell/cc-strength-bar.c
+++ b/shell/cc-strength-bar.c
@@ -26,6 +26,7 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <math.h>
#include "cc-strength-bar.h"
@@ -254,7 +255,7 @@ cc_strength_bar_draw (GtkWidget *widget,
/* print the bar */
section_width = (width - (padding_end * 2) + 2) / (gdouble) bar->priv->segments;
- count = bar->priv->fraction * (gdouble) bar->priv->segments;
+ count = ceil (bar->priv->fraction * (gdouble) bar->priv->segments);
last_x = -padding_x + padding_end;
for (i = 0; i < count; i++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]