[gnome-screensaver] fade: fix fade computation math
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screensaver] fade: fix fade computation math
- Date: Wed, 21 Mar 2012 19:45:08 +0000 (UTC)
commit 7e2085ab60d144ada580eb91d339332cb94e6811
Author: Ray Strode <rstrode redhat com>
Date: Wed Mar 21 15:30:06 2012 -0400
fade: fix fade computation math
commit 44edc03104 changed the fade time out to be less
than a 1000ms. Unfortunately, this broke the fade because the
math for computing the number of fade steps used integer arithmetic,
and performed a division by a 1000.
https://bugzilla.gnome.org/show_bug.cgi?id=672583
src/gs-fade.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-fade.c b/src/gs-fade.c
index d135b35..20768b6 100644
--- a/src/gs-fade.c
+++ b/src/gs-fade.c
@@ -726,7 +726,7 @@ gs_fade_start (GSFade *fade,
if (active_fade) {
guint num_steps;
- num_steps = (fade->priv->timeout / 1000) * steps_per_sec;
+ num_steps = (fade->priv->timeout / 1000.) * steps_per_sec;
msecs_per_step = 1000 / steps_per_sec;
fade->priv->alpha_per_iter = 1.0 / (gdouble)num_steps;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]