diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-02-05 22:06:56 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-02-06 16:16:44 -0500 |
commit | cc6fcbfc093d17b6df8a9f23131d776c7a7bb89a (patch) | |
tree | dda51022b4402bf006c3c0e8ebb639ecb25505eb /gtk/gtkcssfiltervalue.c | |
parent | ea7185bdb1ba423495340a9b880e619a861064fd (diff) | |
download | gtk+-cc6fcbfc093d17b6df8a9f23131d776c7a7bb89a.tar.gz |
cssfiltervalue: Fix blur filter interpretation
According to https://www.w3.org/TR/filter-effects-1/,
the length passed to blur() is the standard deviation,
and according to https://www.w3.org/TR/css-backgrounds-3/#shadow-blur
the blur radius is twice the standard deviation.
Diffstat (limited to 'gtk/gtkcssfiltervalue.c')
-rw-r--r-- | gtk/gtkcssfiltervalue.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/gtkcssfiltervalue.c b/gtk/gtkcssfiltervalue.c index ecc225a925..eaf11c16b5 100644 --- a/gtk/gtkcssfiltervalue.c +++ b/gtk/gtkcssfiltervalue.c @@ -939,7 +939,6 @@ gtk_css_filter_value_push_snapshot (const GtkCssValue *filter, graphene_matrix_t matrix; graphene_vec4_t offset; int i, j; - double radius; if (gtk_css_filter_value_is_none (filter)) return; @@ -955,8 +954,8 @@ gtk_css_filter_value_push_snapshot (const GtkCssValue *filter, { if (filter->filters[j].type == GTK_CSS_FILTER_BLUR) { - radius = _gtk_css_number_value_get (filter->filters[j].blur.value, 100.0); - gtk_snapshot_push_blur (snapshot, radius); + double std_dev = _gtk_css_number_value_get (filter->filters[j].blur.value, 100.0); + gtk_snapshot_push_blur (snapshot, 2 * std_dev); } else if (filter->filters[j].type == GTK_CSS_FILTER_DROP_SHADOW) { |