[librsvg] bgo#634324 - Gaussian blur with negative-scaling transformation matrix is not rendered



commit f7ccfbff857b5ec8d7ace494e20f28d97f1c91f1
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Apr 18 11:22:18 2017 -0500

    bgo#634324 - Gaussian blur with negative-scaling transformation matrix is not rendered
    
    When we figure out the standard deviations for Gaussian blurs, we were
    simply multiplying the given values by the scaling factors in the current
    transformation.  But if this is a negative-scaling matrix, we'd get
    negative values, and we would not do a blur at all.
    
    Take the absolute value of the scaled factors instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=634324

 rsvg-filter.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/rsvg-filter.c b/rsvg-filter.c
index a4623ef..b517d72 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -1902,7 +1902,7 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgNode *node, RsvgFilterPrimitive
     int width, height;
     cairo_surface_t *output, *in;
     RsvgIRect boundarys;
-    gfloat sdx, sdy;
+    gdouble sdx, sdy;
     RsvgFilterPrimitiveOutput op;
     cairo_t *cr;
 
@@ -1922,8 +1922,8 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgNode *node, RsvgFilterPrimitive
     }
 
     /* scale the SD values */
-    sdx = gaussian->sdx * ctx->paffine.xx;
-    sdy = gaussian->sdy * ctx->paffine.yy;
+    sdx = fabs (gaussian->sdx * ctx->paffine.xx);
+    sdy = fabs (gaussian->sdy * ctx->paffine.yy);
 
     gaussian_blur_surface (in, output, sdx, sdy);
 


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