From bb9d08a3e32859491a125d8567f387a702795267 Mon Sep 17 00:00:00 2001 From: Niko Kiirala Date: Sat, 23 Jun 2007 15:35:28 +0000 Subject: Using the blur slider no longer destroys filters already applied to the object (bzr r3086) --- src/desktop-style.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index 9c7cbb35f..95abdfa5b 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -1040,23 +1040,26 @@ objects_query_blur (GSList *objects, SPStyle *style_res) //if object has a filter if (style->filter.set && style->filter.filter) { //cycle through filter primitives - for(int i=0; ifilter.filter->_primitive_count; i++) - { - SPFilterPrimitive *primitive = style->filter.filter->_primitives[i]; - //if primitive is gaussianblur - if(SP_IS_GAUSSIANBLUR(primitive)) { - SPGaussianBlur * spblur = SP_GAUSSIANBLUR(primitive); - float num = spblur->stdDeviation.getNumber(); - blur_sum += num * NR::expansion(i2d); - if (blur_prev != -1 && fabs (num - blur_prev) > 1e-2) // rather low tolerance because difference in blur radii is much harder to notice than e.g. difference in sizes - same_blur = false; - blur_prev = num; - //TODO: deal with opt number, for the moment it's not necessary to the ui. - blur_items ++; + SPObject *primitive_obj = style->filter.filter->children; + while (primitive_obj) { + if (SP_IS_FILTER_PRIMITIVE(primitive_obj)) { + SPFilterPrimitive *primitive = SP_FILTER_PRIMITIVE(primitive_obj); + + //if primitive is gaussianblur + if(SP_IS_GAUSSIANBLUR(primitive)) { + SPGaussianBlur * spblur = SP_GAUSSIANBLUR(primitive); + float num = spblur->stdDeviation.getNumber(); + blur_sum += num * NR::expansion(i2d); + if (blur_prev != -1 && fabs (num - blur_prev) > 1e-2) // rather low tolerance because difference in blur radii is much harder to notice than e.g. difference in sizes + same_blur = false; + blur_prev = num; + //TODO: deal with opt number, for the moment it's not necessary to the ui. + blur_items ++; + } } + primitive_obj = primitive_obj->next; } } - } if (items > 0) { -- cgit v1.2.3