summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2007-07-16 22:24:23 +0000
committernicholasbishop <nicholasbishop@users.sourceforge.net>2007-07-16 22:24:23 +0000
commit562bcd4f36d1625b907d65d748653e4299974445 (patch)
tree5d330dcf9be0a6c24a85d244897a234f99012380 /src
parentfix compiler warning on ordering of init in uri-references.cpp (diff)
downloadinkscape-562bcd4f36d1625b907d65d748653e4299974445.tar.gz
inkscape-562bcd4f36d1625b907d65d748653e4299974445.zip
Filter effects dialog:
* A coule bug fixes; attempting to connect the first filter primitive to another is no longer allowed, same for attempting to connect the input of a filter primitive to its own result. Still todo is preventing a connection to a later primitive. (bzr r3256)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index f1da6395c..7263af448 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -511,13 +511,16 @@ bool FilterEffectsDialog::PrimitiveList::on_button_press_event(GdkEventButton* e
int cx, cy;
if(get_path_at_pos(x, y, path, col, cx, cy)) {
- std::vector<Gdk::Point> points;
- if(do_connection_node(_model->get_iter(path), 0, points, x, y))
- _in_drag = 1;
- else if(do_connection_node(_model->get_iter(path), 1, points, x, y))
- _in_drag = 2;
-
- queue_draw();
+ Gtk::TreeIter iter = _model->get_iter(path);
+ if(iter != _model->children().begin()) {
+ std::vector<Gdk::Point> points;
+ if(do_connection_node(_model->get_iter(path), 0, points, x, y))
+ _in_drag = 1;
+ else if(do_connection_node(_model->get_iter(path), 1, points, x, y))
+ _in_drag = 2;
+
+ queue_draw();
+ }
}
return Gtk::TreeView::on_button_press_event(e);
@@ -540,20 +543,29 @@ 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];
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(target);
- // Make sure the target has a result
- const gchar *gres = repr->attribute("result");
- Glib::ustring result = gres ? gres : "";
- if(!gres) {
- result = "result" + Glib::Ascii::dtostr(SP_FILTER(prim->parent)->_image_number_next);
- repr->setAttribute("result", result.c_str());
+ 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();
+ }
+ else
+ in_val = gres;
}
if(_in_drag == 1)
- SP_OBJECT_REPR(prim)->setAttribute("in", result.c_str());
+ SP_OBJECT_REPR(prim)->setAttribute("in", in_val);
else if(_in_drag == 2)
- SP_OBJECT_REPR(prim)->setAttribute("in2", result.c_str());
+ SP_OBJECT_REPR(prim)->setAttribute("in2", in_val);
}
_in_drag = 0;