diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-11-09 05:13:46 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-11-09 05:13:46 +0000 |
| commit | 4b236f3f1e3fe5374e18dac9e6c35567d9dc0995 (patch) | |
| tree | d6a8f361b37294feb8da05c2ce61271e5137a237 /src/live_effects/parameter/filletchamferpointarray.cpp | |
| parent | Remove FIXME from refactoring (diff) | |
| parent | Fix bug in previous commit. Add test against it (diff) | |
| download | inkscape-4b236f3f1e3fe5374e18dac9e6c35567d9dc0995.tar.gz inkscape-4b236f3f1e3fe5374e18dac9e6c35567d9dc0995.zip | |
Update to trunk r13690
(bzr r13341.5.22)
Diffstat (limited to 'src/live_effects/parameter/filletchamferpointarray.cpp')
| -rw-r--r-- | src/live_effects/parameter/filletchamferpointarray.cpp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/live_effects/parameter/filletchamferpointarray.cpp b/src/live_effects/parameter/filletchamferpointarray.cpp index db24a9735..31d996ad0 100644 --- a/src/live_effects/parameter/filletchamferpointarray.cpp +++ b/src/live_effects/parameter/filletchamferpointarray.cpp @@ -359,6 +359,11 @@ void FilletChamferPointArrayParam::set_helper_size(int hs) helper_size = hs; } +void FilletChamferPointArrayParam::set_chamfer_steps(int value_chamfer_steps) +{ + chamfer_steps = value_chamfer_steps; +} + void FilletChamferPointArrayParam::set_use_distance(bool use_knot_distance ) { use_distance = use_knot_distance; @@ -712,8 +717,8 @@ FilletChamferPointArrayParamKnotHolderEntity( : _pparam(p), _index(index) {} void FilletChamferPointArrayParamKnotHolderEntity::knot_set(Point const &p, - Point const &origin, - guint state) + Point const &/*origin*/, + guint /*state*/) { using namespace Geom; @@ -766,15 +771,24 @@ void FilletChamferPointArrayParamKnotHolderEntity::knot_click(guint state) sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false); }else{ using namespace Geom; - double type = _pparam->_vector.at(_index)[Y] + 1; - if (type > 4) { - type = 1; + int type = (int)_pparam->_vector.at(_index)[Y]; + + switch(type){ + case 1: + type = 2; + break; + case 2: + type = _pparam->chamfer_steps; + break; + default: + type = 1; + break; } - _pparam->_vector.at(_index) = Point(_pparam->_vector.at(_index)[X], type); + _pparam->_vector.at(_index) = Point(_pparam->_vector.at(_index)[X], (double)type); _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) { + if (type >= 3) { tip = _("<b>Chamfer</b>: <b>Ctrl+Click</b> toogle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); @@ -782,12 +796,8 @@ void FilletChamferPointArrayParamKnotHolderEntity::knot_click(guint state) tip = _("<b>Inverse Fillet</b>: <b>Ctrl+Click</b> toogle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); - } else if (type == 1) { - tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, " - "<b>Shift+Click</b> open dialog, " - "<b>Ctrl+Alt+Click</b> reset"); } else { - tip = _("<b>Double Chamfer</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } @@ -835,7 +845,7 @@ void FilletChamferPointArrayParam::addKnotHolderEntities(KnotHolder *knotholder, continue; } const gchar *tip; - if (_vector[i][Y] == 3) { + if (_vector[i][Y] >= 3) { tip = _("<b>Chamfer</b>: <b>Ctrl+Click</b> toogle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); @@ -843,12 +853,8 @@ void FilletChamferPointArrayParam::addKnotHolderEntities(KnotHolder *knotholder, tip = _("<b>Inverse Fillet</b>: <b>Ctrl+Click</b> toogle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); - } else if (_vector[i][Y] == 1) { - tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, " - "<b>Shift+Click</b> open dialog, " - "<b>Ctrl+Alt+Click</b> reset"); } else { - tip = _("<b>Double Chamfer</b>: <b>Ctrl+Click</b> toogle type, " + tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, " "<b>Shift+Click</b> open dialog, " "<b>Ctrl+Alt+Click</b> reset"); } |
