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
This commit is contained in:
Florian Müllner 2014-06-07 12:21:03 +02:00
parent fba022cc06
commit 98e219da4b

View File

@ -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);