[gnome-settings-daemon] color: Fix smearing out of Night Light effect



commit 33481c5c55246cf75328702ed1997bc9aa377c94
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jul 5 06:03:46 2017 +0200

    color: Fix smearing out of Night Light effect
    
    The interpolation function expects factor values between 0. and 1.,
    so we need to either pass the difference between current time and
    transition start, or between transition end and current time - not
    the difference between transition start and current time, which is
    always negative.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778667

 plugins/color/gsd-night-light.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/color/gsd-night-light.c b/plugins/color/gsd-night-light.c
index 67415f1..a8818de 100644
--- a/plugins/color/gsd-night-light.c
+++ b/plugins/color/gsd-night-light.c
@@ -320,7 +320,7 @@ night_light_recheck (GsdNightLight *self)
         } else if (gsd_night_light_frac_day_is_between (frac_day,
                                                           schedule_to - smear,
                                                           schedule_to)) {
-                gdouble factor = ((schedule_to - smear) - frac_day) / smear;
+                gdouble factor = (frac_day - (schedule_to - smear)) / smear;
                 temp_smeared = linear_interpolate (GSD_COLOR_TEMPERATURE_DEFAULT,
                                                    temperature, factor);
         } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]