From: Johan Engelen Date: Wed, 28 Jul 2010 21:41:55 +0000 (+0200) Subject: powerstroke: ctrl+click inserts new stroke knot. BUGGY. reselect object after adding... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c7818b8807f3e31b6c97754eaa4f5288c412bdcb;p=inkscape.git powerstroke: ctrl+click inserts new stroke knot. BUGGY. reselect object after adding stroke knot --- 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