Code

powerstroke: ctrl+click inserts new stroke knot. BUGGY. reselect object after adding...
authorJohan Engelen <goejendaagh@zonnet.nl>
Wed, 28 Jul 2010 21:41:55 +0000 (23:41 +0200)
committerJohan Engelen <goejendaagh@zonnet.nl>
Wed, 28 Jul 2010 21:41:55 +0000 (23:41 +0200)
src/live_effects/parameter/powerstrokepointarray.cpp

index 49ef05319e22dcb9b7682ca323c3b00c62f3b1a1..99c32720729876935d9b32a38665720188287b57 100644 (file)
@@ -124,9 +124,17 @@ PowerStrokePointArrayParamKnotHolderEntity::knot_get()
 }
 
 void
-PowerStrokePointArrayParamKnotHolderEntity::knot_click(guint /*state*/)
+PowerStrokePointArrayParamKnotHolderEntity::knot_click(guint state)
 {
     g_print ("This is the %d handle associated to parameter '%s'\n", _index, _pparam->param_key.c_str());
+
+    if (state & GDK_CONTROL_MASK) {
+        std::vector<Geom::Point> & vec = _pparam->_vector;
+        vec.insert(vec.begin() + _index, 1, vec.at(_index));
+        _pparam->param_set_and_write_new_value(vec);
+        g_print ("Added handle %d associated to parameter '%s'\n", _index, _pparam->param_key.c_str());
+        /// @todo  this BUGS ! the knot stuff should be reloaded when adding a new node!
+    }
 }
 
 void