diff options
| author | MenTaLguY <mental@rydia.net> | 2007-06-24 18:42:24 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-06-24 18:42:24 +0000 |
| commit | e3e060874b3b23d5e47c6e55b8ab612ae533828a (patch) | |
| tree | 57aca26c51c4b331416c44582710221731049013 /src | |
| parent | initial filter UI code drop from Nick (diff) | |
| download | inkscape-e3e060874b3b23d5e47c6e55b8ab612ae533828a.tar.gz inkscape-e3e060874b3b23d5e47c6e55b8ab612ae533828a.zip | |
move blend after blur, and blend with background buffer (enabled as
necessary)
(bzr r3096)
Diffstat (limited to 'src')
| -rw-r--r-- | src/filter-chemistry.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp index 336ac3576..d3a02852e 100644 --- a/src/filter-chemistry.cpp +++ b/src/filter-chemistry.cpp @@ -211,21 +211,6 @@ new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdo // get corresponding object SPFilter *f = SP_FILTER( document->getObjectByRepr(repr) ); - // Blend primitive - if(strcmp(blendmode, "normal")) { - Inkscape::XML::Node *b_repr; - b_repr = xml_doc->createElement("svg:feBlend"); - b_repr->setAttribute("inkscape::collect", "always"); - b_repr->setAttribute("mode", blendmode); - - // set feBlend as child of filter node - repr->appendChild(b_repr); - Inkscape::GC::release(b_repr); - - SPFeBlend *b = SP_FEBLEND(document->getObjectByRepr(b_repr)); - g_assert(b != NULL); - g_assert(SP_IS_FEBLEND(b)); - } // Gaussian blur primitive if(radius != 0) { set_filter_area(repr, radius, expansion, expansionX, expansionY, width, height); @@ -250,6 +235,28 @@ new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdo g_assert(b != NULL); g_assert(SP_IS_GAUSSIANBLUR(b)); } + // Blend primitive + if(strcmp(blendmode, "normal")) { + Inkscape::XML::Node *b_repr; + b_repr = xml_doc->createElement("svg:feBlend"); + b_repr->setAttribute("inkscape:collect", "always"); + b_repr->setAttribute("mode", blendmode); + b_repr->setAttribute("in2", "BackgroundImage"); + + // set feBlend as child of filter node + repr->appendChild(b_repr); + Inkscape::GC::release(b_repr); + + // Enable background image buffer for document + Inkscape::XML::Node *root = b_repr->root(); + if (!root->attribute("enable-background")) { + root->setAttribute("enable-background", "new"); + } + + SPFeBlend *b = SP_FEBLEND(document->getObjectByRepr(b_repr)); + g_assert(b != NULL); + g_assert(SP_IS_FEBLEND(b)); + } g_assert(f != NULL); g_assert(SP_IS_FILTER(f)); |
