[gnome-color-manager: 46/80] huey: fix the multipliers for very low numbers
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager: 46/80] huey: fix the multipliers for very low numbers
- Date: Mon, 19 Jul 2010 11:36:19 +0000 (UTC)
commit 568fefc6965d3005861e6ad7a8fcf4f1c94d7f46
Author: Richard Hughes <richard hughsie com>
Date: Sat Jul 17 23:10:38 2010 +0100
huey: fix the multipliers for very low numbers
src/gcm-huey-example.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/gcm-huey-example.c b/src/gcm-huey-example.c
index 9484ddc..d643f81 100644
--- a/src/gcm-huey-example.c
+++ b/src/gcm-huey-example.c
@@ -762,11 +762,11 @@ gcm_sensor_huey_get_color (GcmSensorHuey *huey, GcmColorRgb *values, GError **er
/* compromise between the amount of time and the precision */
value = HUEY_PRECISION_TIME_VALUE;
if (values->red < value)
- multiplier.red = value / values->red;
+ multiplier.red = (gfloat)value / values->red;
if (values->green < value)
- multiplier.green = value / values->green;
+ multiplier.green = (gfloat)value / values->green;
if (values->blue < value)
- multiplier.blue = value / values->blue;
+ multiplier.blue = (gfloat)value / values->blue;
g_debug ("using multiplier factor: red=%i, green=%i, blue=%i", multiplier.red, multiplier.green, multiplier.blue);
ret = gcm_sensor_huey_get_color_for_threshold (huey, &multiplier, values, error);
if (!ret)
@@ -775,7 +775,7 @@ gcm_sensor_huey_get_color (GcmSensorHuey *huey, GcmColorRgb *values, GError **er
values->red = HUEY_SCALE_VALUE_RED * values->red / multiplier.red;
values->green = HUEY_SCALE_VALUE_GREEN * values->green / multiplier.green;
values->blue = HUEY_SCALE_VALUE_BLUE * values->blue / multiplier.blue;
-// g_debug ("scaled values: red=%0.4lf, green=%0.4lf, blue=%0.4lf", values->red, values->green, values->blue);
+ g_debug ("scaled values: red=%0.4lf, green=%0.4lf, blue=%0.4lf", values->red, values->green, values->blue);
g_assert (values->red < 1.0f);
g_assert (values->green < 1.0f);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]