diff options
| author | Niko Kiirala <niko@kiirala.com> | 2007-06-23 15:35:28 +0000 |
|---|---|---|
| committer | kiirala <kiirala@users.sourceforge.net> | 2007-06-23 15:35:28 +0000 |
| commit | bb9d08a3e32859491a125d8567f387a702795267 (patch) | |
| tree | 3322ec862746beee7119d8e44e2e47185ae80916 /src/desktop-style.cpp | |
| parent | Added polar coordinates. (diff) | |
| download | inkscape-bb9d08a3e32859491a125d8567f387a702795267.tar.gz inkscape-bb9d08a3e32859491a125d8567f387a702795267.zip | |
Using the blur slider no longer destroys filters already applied to the object
(bzr r3086)
Diffstat (limited to 'src/desktop-style.cpp')
| -rw-r--r-- | src/desktop-style.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
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; i<style->filter.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) { |
