summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-05 18:30:49 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-05 18:30:49 +0000
commitf51e8d7c6b4e2caa9e470af674949f3cd1695bf5 (patch)
tree2a733dbe915ff764ee9df8ac5840fa084c3f2ffc /src/live_effects/parameter
parentSymbols. Fix for bug #1388910 (There is an unnecessary character in MapSymbol... (diff)
downloadinkscape-f51e8d7c6b4e2caa9e470af674949f3cd1695bf5.tar.gz
inkscape-f51e8d7c6b4e2caa9e470af674949f3cd1695bf5.zip
Refactor to remove references to Desktop/Ui in Effect, bspline and fillet-chamfer.
Also fixed the selected node problem in units not px. Also fixed two var to not allow NULL pointed by Johan Engelen. (bzr r13672)
Diffstat (limited to 'src/live_effects/parameter')
-rw-r--r--src/live_effects/parameter/filletchamferpointarray.cpp28
-rw-r--r--src/live_effects/parameter/filletchamferpointarray.h2
2 files changed, 18 insertions, 12 deletions
diff --git a/src/live_effects/parameter/filletchamferpointarray.cpp b/src/live_effects/parameter/filletchamferpointarray.cpp
index f43f6108d..31d996ad0 100644
--- a/src/live_effects/parameter/filletchamferpointarray.cpp
+++ b/src/live_effects/parameter/filletchamferpointarray.cpp
@@ -359,9 +359,9 @@ void FilletChamferPointArrayParam::set_helper_size(int hs)
helper_size = hs;
}
-void FilletChamferPointArrayParam::set_chamferSteps(int chamferSteps)
+void FilletChamferPointArrayParam::set_chamfer_steps(int value_chamfer_steps)
{
- chamfer_steps = chamferSteps;
+ chamfer_steps = value_chamfer_steps;
}
void FilletChamferPointArrayParam::set_use_distance(bool use_knot_distance )
@@ -771,14 +771,20 @@ 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 > 3) {
- 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;
}
- if (type == 3){
- type = _pparam->chamfer_steps;
- }
- _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;
@@ -790,7 +796,7 @@ 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) {
+ } else {
tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, "
"<b>Shift+Click</b> open dialog, "
"<b>Ctrl+Alt+Click</b> reset");
@@ -847,7 +853,7 @@ 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) {
+ } else {
tip = _("<b>Fillet</b>: <b>Ctrl+Click</b> toogle type, "
"<b>Shift+Click</b> open dialog, "
"<b>Ctrl+Alt+Click</b> reset");
diff --git a/src/live_effects/parameter/filletchamferpointarray.h b/src/live_effects/parameter/filletchamferpointarray.h
index 3ef52d11a..1dd31d6d4 100644
--- a/src/live_effects/parameter/filletchamferpointarray.h
+++ b/src/live_effects/parameter/filletchamferpointarray.h
@@ -52,7 +52,7 @@ public:
std::vector<double> get_times(int index, std::vector<Geom::Path> subpaths, bool last);
virtual void set_helper_size(int hs);
virtual void set_use_distance(bool use_knot_distance);
- virtual void set_chamferSteps(int chamferSteps);
+ virtual void set_chamfer_steps(int value_chamfer_steps);
virtual void set_unit(const gchar *abbr);
virtual void addCanvasIndicators(SPLPEItem const *lpeitem,
std::vector<Geom::PathVector> &hp_vec);