summaryrefslogtreecommitdiffstats
path: root/src/shape-editor.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-10-20 15:43:07 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-10-20 15:43:07 +0000
commit82a86b15d8cdd5040d65fa27ea59237d6e7c7ed3 (patch)
treef2607d956b1ce9c96bf57193b77913e074039ea9 /src/shape-editor.cpp
parentAdding config option to block use of libpoppler-cairo (for misdetected situta... (diff)
downloadinkscape-82a86b15d8cdd5040d65fa27ea59237d6e7c7ed3.tar.gz
inkscape-82a86b15d8cdd5040d65fa27ea59237d6e7c7ed3.zip
LPE: add on-canvas editing of path parameters!
(bzr r3934)
Diffstat (limited to 'src/shape-editor.cpp')
-rw-r--r--src/shape-editor.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp
index d0dbb8937..abffeefc4 100644
--- a/src/shape-editor.cpp
+++ b/src/shape-editor.cpp
@@ -16,6 +16,7 @@
#include "sp-object.h"
#include "sp-item.h"
+#include "live_effects/lpeobject.h"
#include "selection.h"
#include "desktop.h"
#include "desktop-handles.h"
@@ -113,7 +114,7 @@ void ShapeEditor::decrement_local_change () {
SPItem *ShapeEditor::get_item () {
SPItem *item = NULL;
if (this->has_nodepath()) {
- item = SP_ITEM(this->nodepath->object);
+ item = this->nodepath->item;
} else if (this->has_knotholder()) {
item = SP_ITEM(this->knotholder->item);
}
@@ -208,29 +209,26 @@ void ShapeEditor::set_item(SPItem *item) {
}
}
-void ShapeEditor::set_livepatheffect_parameter(SPObject *lpeobject, const char * key) {
+/** Please note that this function only works for path parameters.
+* All other parameters probably will crash Inkscape!
+* Fortunately, there are no other on-canvas edittable objects at this moment :)
+*/
+void ShapeEditor::set_item_livepatheffect_parameter(SPItem *item, SPObject *lpeobject, const char * key) {
unset_item();
this->grab_node = -1;
if (lpeobject) {
+ this->knotholder = NULL; // it's a path, no special knotholder needed.
this->nodepath = sp_nodepath_new( desktop, lpeobject,
(prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0),
- key);
+ key, item);
if (this->nodepath) {
this->nodepath->shape_editor = this;
- }
- //this->knotholder = sp_item_knot_holder(item, desktop);
- g_message("create knotholder?");
- if (this->nodepath || this->knotholder) {
// setting new listener
- Inkscape::XML::Node *repr;
- if (this->knotholder)
- repr = this->knotholder->repr;
- else
- repr = SP_OBJECT_REPR(lpeobject);
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(lpeobject);
if (repr) {
Inkscape::GC::anchor(repr);
sp_repr_add_listener(repr, &shapeeditor_repr_events, this);