Code

Filter effects dialog:
authornicholasbishop <nicholasbishop@users.sourceforge.net>
Tue, 17 Jul 2007 02:27:39 +0000 (02:27 +0000)
committernicholasbishop <nicholasbishop@users.sourceforge.net>
Tue, 17 Jul 2007 02:27:39 +0000 (02:27 +0000)
* Prevent filter primitive connections to primitives that come after the selected primitive.

src/filter-chemistry.cpp
src/ui/dialog/filter-effects-dialog.cpp

index d9bf33d60ca1a3489adc7591e3aea7827e4fa3f3..9317ed0826dd6e036b33df726f12cfc10d84b06d 100644 (file)
@@ -143,7 +143,7 @@ filter_add_primitive(SPFilter *filter, const NR::FilterPrimitiveType type)
         case NR::NR_FILTER_FLOOD:
             break;
         case NR::NR_FILTER_GAUSSIANBLUR:
-            repr->setAttribute("stddeviation", "1");
+            repr->setAttribute("stdDeviation", "1");
             break;
         case NR::NR_FILTER_IMAGE:
             break;
index 7263af4489f2728593ff805a1635cd0988cf0b83..18610f613b6dcb37962d6a6331c14ee6d826a7eb 100644 (file)
@@ -543,23 +543,27 @@ bool FilterEffectsDialog::PrimitiveList::on_button_release_event(GdkEventButton*
         int cx, cy;
         
         if(get_path_at_pos((int)e->x, (int)e->y, path, col, cx, cy)) {
-            const gchar *in_val;
-            target = (*_model->get_iter(path))[_columns.primitive];
-            if(target == prim) {
-                in_val = 0;
-            }
-            else {
-                Inkscape::XML::Node *repr = SP_OBJECT_REPR(target);
-                // Make sure the target has a result
-                const gchar *gres = repr->attribute("result");
-                if(!gres) {
-                    const Glib::ustring result = "result" +
-                        Glib::Ascii::dtostr(SP_FILTER(prim->parent)->_image_number_next);
-                    repr->setAttribute("result", result.c_str());
-                    in_val = result.c_str();
+            const gchar *in_val = 0;
+            Gtk::TreeIter target_iter = _model->get_iter(path);
+            target = (*target_iter)[_columns.primitive];
+
+            // Ensure that the target comes before the selected primitive
+            for(Gtk::TreeIter iter = _model->children().begin();
+                iter != get_selection()->get_selected(); ++iter) {
+                if(iter == target_iter) {
+                    Inkscape::XML::Node *repr = SP_OBJECT_REPR(target);
+                    // Make sure the target has a result
+                    const gchar *gres = repr->attribute("result");
+                    if(!gres) {
+                        const Glib::ustring result = "result" +
+                            Glib::Ascii::dtostr(SP_FILTER(prim->parent)->_image_number_next);
+                        repr->setAttribute("result", result.c_str());
+                        in_val = result.c_str();
+                    }
+                    else
+                        in_val = gres;
+                    break;
                 }
-                else
-                    in_val = gres;
             }
 
             if(_in_drag == 1)