[mutter] shadow-factory: Make sure to never use a negative spread



commit 98e219da4b8d18be05cd9346ed96c6a86962e801
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jun 7 12:21:03 2014 +0200

    shadow-factory: Make sure to never use a negative spread
    
    The smallest possible spread corresponds to an unblurred shadow, which
    neither grows nor shrinks - thus the spread should be zero not negative
    as returned by our current calculation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731353

 src/compositor/meta-shadow-factory.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c
index 6f02ef5..a5bce48 100644
--- a/src/compositor/meta-shadow-factory.c
+++ b/src/compositor/meta-shadow-factory.c
@@ -496,7 +496,12 @@ get_box_filter_size (int radius)
 static int
 get_shadow_spread (int radius)
 {
-  int d = get_box_filter_size (radius);
+  int d;
+
+  if (radius == 0)
+    return 0;
+
+  d = get_box_filter_size (radius);
 
   if (d % 2 == 1)
     return 3 * (d / 2);


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