From 87469d81799b58681b91800234f266ea8b19b30b Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 14 Nov 2014 01:08:40 +0100 Subject: Add inverse subdivision chamfer to fillet chamfer LPE, feature sugested by Ivan Louette. (bzr r13708) --- .../parameter/filletchamferpointarray.cpp | 32 ++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'src/live_effects/parameter/filletchamferpointarray.cpp') diff --git a/src/live_effects/parameter/filletchamferpointarray.cpp b/src/live_effects/parameter/filletchamferpointarray.cpp index cf9ef3132..4e2be6e88 100644 --- a/src/live_effects/parameter/filletchamferpointarray.cpp +++ b/src/live_effects/parameter/filletchamferpointarray.cpp @@ -723,7 +723,7 @@ FilletChamferPointArrayParamKnotHolderEntity( void FilletChamferPointArrayParamKnotHolderEntity::knot_set(Point const &p, Point const &/*origin*/, - guint /*state*/) + guint state) { using namespace Geom; @@ -733,7 +733,7 @@ void FilletChamferPointArrayParamKnotHolderEntity::knot_set(Point const &p, /// @todo how about item transforms??? Piecewise > const &pwd2 = _pparam->get_pwd2(); //todo: add snapping - //Geom::Point const s = snap_knot_position(p, state); + Geom::Point const s = snap_knot_position(p, state); double t = nearest_point(p, pwd2[_index]); if (t == 1) { t = 0.9999; @@ -777,13 +777,21 @@ void FilletChamferPointArrayParamKnotHolderEntity::knot_click(guint state) }else{ using namespace Geom; int type = (int)_pparam->_vector.at(_index)[Y]; - + if (type >=3000 && type < 4000){ + type = 3; + } + if (type >=4000 && type < 5000){ + type = 4; + } switch(type){ case 1: type = 2; break; case 2: - type = _pparam->chamfer_steps; + type = _pparam->chamfer_steps + 3000; + break; + case 3: + type = _pparam->chamfer_steps + 4000; break; default: type = 1; @@ -793,8 +801,12 @@ void FilletChamferPointArrayParamKnotHolderEntity::knot_click(guint state) _pparam->param_set_and_write_new_value(_pparam->_vector); sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false); const gchar *tip; - if (type >= 3) { - tip = _("Chamfer: Ctrl+Click toogle type, " + if (type >=3000 && type < 4000){ + tip = _("Chamfer: Ctrl+Click toogle type, " + "Shift+Click open dialog, " + "Ctrl+Alt+Click reset"); + } else if (type >=4000 && type < 5000) { + tip = _("Inverse Chamfer: Ctrl+Click toogle type, " "Shift+Click open dialog, " "Ctrl+Alt+Click reset"); } else if (type == 2) { @@ -850,8 +862,12 @@ void FilletChamferPointArrayParam::addKnotHolderEntities(KnotHolder *knotholder, continue; } const gchar *tip; - if (_vector[i][Y] >= 3) { - tip = _("Chamfer: Ctrl+Click toogle type, " + if (_vector[i][Y] >=3000 && _vector[i][Y] < 4000){ + tip = _("Chamfer: Ctrl+Click toogle type, " + "Shift+Click open dialog, " + "Ctrl+Alt+Click reset"); + } else if (_vector[i][Y] >=4000 && _vector[i][Y] < 5000) { + tip = _("Inverse Chamfer: Ctrl+Click toogle type, " "Shift+Click open dialog, " "Ctrl+Alt+Click reset"); } else if (_vector[i][Y] == 2) { -- cgit v1.2.3