From c7818b8807f3e31b6c97754eaa4f5288c412bdcb Mon Sep 17 00:00:00 2001 From: Johan Engelen Date: Wed, 28 Jul 2010 23:41:55 +0200 Subject: [PATCH] powerstroke: ctrl+click inserts new stroke knot. BUGGY. reselect object after adding stroke knot --- src/live_effects/parameter/powerstrokepointarray.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp index 49ef05319..99c327207 100644 --- a/src/live_effects/parameter/powerstrokepointarray.cpp +++ b/src/live_effects/parameter/powerstrokepointarray.cpp @@ -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 & 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 -- 2.30.2