X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Finternal%2Fbluredge.cpp;h=aa1f3ece3fa29852248e95473bd153a6e75fe63d;hb=7a7fa095a483e8b652af9f00e5169f62c84f09b9;hp=cbfe906ee6b23f5c852d1d437602c0efb2574ca1;hpb=7791797492aed22ddeede22d237fbdc996c0d31b;p=inkscape.git diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index cbfe906ee..aa1f3ece3 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -12,6 +12,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include #include "desktop.h" #include "selection.h" #include "helper/action.h" @@ -65,16 +66,14 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View items.insert >(items.end(), selection->itemList(), NULL); selection->clear(); - std::list new_items; for(std::list::iterator item = items.begin(); item != items.end(); item++) { SPItem * spitem = *item; - Inkscape::XML::Node * new_items[steps]; - Inkscape::XML::Node * new_group = sp_repr_new("svg:g"); + std::vector new_items(steps); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document->doc()); + Inkscape::XML::Node * new_group = xml_doc->createElement("svg:g"); (SP_OBJECT_REPR(spitem)->parent())->appendChild(new_group); - /** \todo Need to figure out how to get from XML::Node to SPItem */ - /* new_items.push_back(); */ double orig_opacity = sp_repr_css_double_property(sp_repr_css_attr(SP_OBJECT_REPR(spitem), "style"), "opacity", 1.0); char opacity_string[64]; @@ -84,7 +83,7 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View for (int i = 0; i < steps; i++) { double offset = (width / (float)(steps - 1) * (float)i) - (width / 2.0); - new_items[i] = (SP_OBJECT_REPR(spitem))->duplicate(); + new_items[i] = (SP_OBJECT_REPR(spitem))->duplicate(xml_doc); SPCSSAttr * css = sp_repr_css_attr(new_items[i], "style"); sp_repr_css_set_property(css, "opacity", opacity_string); @@ -99,8 +98,7 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View offset *= -1.0; prefs_set_double_attribute("options.defaultoffsetwidth", "value", offset); sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_INSET)->get_action(document), NULL); - } else if (offset == 0.0) { - } else { + } else if (offset > 0.0) { prefs_set_double_attribute("options.defaultoffsetwidth", "value", offset); sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_OFFSET)->get_action(document), NULL); } @@ -114,15 +112,14 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View selection->clear(); selection->add(items.begin(), items.end()); - selection->add(new_items.begin(), new_items.end()); return; } Gtk::Widget * -BlurEdge::prefs_effect(Inkscape::Extension::Effect * module, Inkscape::UI::View::View * view) +BlurEdge::prefs_effect(Inkscape::Extension::Effect * module, Inkscape::UI::View::View * view, sigc::signal * changeSignal) { - return module->autogui(); + return module->autogui(NULL, NULL, changeSignal); } #include "clear-n_.h" @@ -132,10 +129,10 @@ BlurEdge::init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Blur Edge") "\n" + "" N_("Inset/Outset Halo") "\n" "org.inkscape.effect.bluredge\n" - "1.0\n" - "11\n" + "1.0\n" + "11\n" "\n" "all\n" "\n"