From 98e219da4b8d18be05cd9346ed96c6a86962e801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 7 Jun 2014 12:21:03 +0200 Subject: [PATCH] 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 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c index 6f02ef58b..a5bce4895 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);