From 1bef7d3a1a351d92449407c344e301b5a655f1b2 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 26 Feb 2008 13:57:53 +0000 Subject: [PATCH] 2008-02-26 Emmanuele Bassi * clutter/clutter-alpha.c: (clutter_exp_inc_func), (clutter_exp_dec_func): Clamp the value of the alpha function between [0, MAX_ALPHA]. (#800) --- ChangeLog | 6 ++++++ clutter/clutter-alpha.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 525164ed4..0c6a82f05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-26 Emmanuele Bassi + + * clutter/clutter-alpha.c: + (clutter_exp_inc_func), (clutter_exp_dec_func): Clamp the value + of the alpha function between [0, MAX_ALPHA]. (#800) + 2008-02-25 Emmanuele Bassi * clutter/clutter-main.c (emit_event): Fix the last commit diff --git a/clutter/clutter-alpha.c b/clutter/clutter-alpha.c index 1b5fe1f74..86f55c778 100644 --- a/clutter/clutter-alpha.c +++ b/clutter/clutter-alpha.c @@ -925,7 +925,7 @@ clutter_exp_inc_func (ClutterAlpha *alpha, x = x_alpha_max * frame / n_frames; - result = clutter_pow2x (x) - 1; + result = CLAMP (clutter_pow2x (x) - 1, 0, CLUTTER_ALPHA_MAX_ALPHA); return result; } @@ -976,7 +976,7 @@ clutter_exp_dec_func (ClutterAlpha *alpha, x = (x_alpha_max * (n_frames - frame)) / n_frames; - result = clutter_pow2x (x) - 1; + result = CLAMP (clutter_pow2x (x) - 1, 0, CLUTTER_ALPHA_MAX_ALPHA); return result; }