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



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

    Backport: bgo#634324 - Gaussian blur with negative-scaling transformation matrix is not rendered
    
    From commit f7ccfbff857b5ec8d7ace494e20f28d97f1c91f1
    
    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 ecca831..7148360 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -1870,7 +1870,7 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgFilterPrimitive * self, RsvgFilt
     int width, height;
     cairo_surface_t *output, *in;
     RsvgIRect boundarys;
-    gfloat sdx, sdy;
+    gdouble sdx, sdy;
     RsvgFilterPrimitiveOutput op;
     cairo_t *cr;
 
@@ -1893,8 +1893,8 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgFilterPrimitive * self, RsvgFilt
     }
 
     /* scale the SD values */
-    sdx = upself->sdx * ctx->paffine.xx;
-    sdy = upself->sdy * ctx->paffine.yy;
+    sdx = fabs (upself->sdx * ctx->paffine.xx);
+    sdy = fabs (upself->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]