summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-08-29 07:52:04 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-08-29 07:52:04 +0000
commit83f03384836c6a130eddfc26cd37cfbb1b3e1790 (patch)
tree0eae282e1a7e53fe0945e47f3284744312703d43 /src
parentCI/AppVeyor: manually install missing dependency (diff)
downloadinkscape-83f03384836c6a130eddfc26cd37cfbb1b3e1790.tar.gz
inkscape-83f03384836c6a130eddfc26cd37cfbb1b3e1790.zip
Remove LPE Simplify from spiro and BSpline mode because made uncontrolable paths. Is retained in bezier mode. Consider backport it
Diffstat (limited to 'src')
-rw-r--r--src/ui/tools/freehand-base.cpp4
-rw-r--r--src/widgets/pencil-toolbar.cpp17
2 files changed, 18 insertions, 3 deletions
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index 76d2df8c5..fdc70af18 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -320,7 +320,9 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
return;
}
bool simplify = prefs->getInt(tool_name(dc) + "/simplify", 0);
- if(simplify){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ guint mode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
+ if(simplify && mode == 0){
double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0);
tol = tol/(100.0*(102.0-tol));
std::ostringstream ss;
diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp
index b15cc5b30..11a5c273f 100644
--- a/src/widgets/pencil-toolbar.cpp
+++ b/src/widgets/pencil-toolbar.cpp
@@ -86,8 +86,12 @@ static void freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl)
}
if (mode == 1 || mode == 2) {
gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_spiro_bspline") ), true );
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_simplify") ), false );
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "simplify") ), false );
} else {
gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_spiro_bspline") ), false );
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_simplify") ), true );
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "simplify") ), true );
}
}
@@ -474,15 +478,21 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb
}
/* LPE simplify based tolerance */
{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
InkToggleAction* itact = ink_toggle_action_new( "PencilLpeSimplify",
_("LPE based interactive simplify"),
_("LPE based interactive simplify"),
INKSCAPE_ICON("interactive_simplify"),
GTK_ICON_SIZE_SMALL_TOOLBAR );
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getInt("/tools/freehand/pencil/simplify", 0) );
+ g_object_set_data( holder, "simplify", itact );
g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ;
gtk_action_group_add_action( mainActions, GTK_ACTION(itact) );
+ guint freehandMode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
+ if (freehandMode == 1 || freehandMode == 2) {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "simplify") ), false );
+ } else {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "simplify") ), true );
+ }
}
/* LPE simplify flatten */
{
@@ -494,7 +504,10 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_simplify_flatten), holder );
gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
g_object_set_data( holder, "flatten_simplify", inky );
- if (!prefs->getInt("/tools/freehand/pencil/simplify", 0)) {
+ guint freehandMode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
+ if (freehandMode == 1 || freehandMode == 2 || !prefs->getInt("/tools/freehand/pencil/simplify", 0)) {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_simplify") ), false );
+ } else {
gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_simplify") ), true );
}
}