diff options
| author | Jabiertxof <jtx@jtx> | 2017-05-07 00:37:49 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx> | 2017-05-07 00:37:49 +0000 |
| commit | 48a1d89571b6da9fe574bcc49f8692b693d6fbf8 (patch) | |
| tree | 7afb0ab8626beced23fb783576495fc26edefafb /src | |
| parent | Reorder LPE enum to match definition in effect.cpp. also fix a bug pointed by... (diff) | |
| download | inkscape-48a1d89571b6da9fe574bcc49f8692b693d6fbf8.tar.gz inkscape-48a1d89571b6da9fe574bcc49f8692b693d6fbf8.zip | |
Improvement to store default line width on join type and tapper stroke pointed by Ede_123 on IRC
(bzr r15671)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-jointype.cpp | 11 | ||||
| -rw-r--r-- | src/live_effects/lpe-taperstroke.cpp | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/live_effects/lpe-jointype.cpp b/src/live_effects/lpe-jointype.cpp index dacb87dd9..0e1e46a94 100644 --- a/src/live_effects/lpe-jointype.cpp +++ b/src/live_effects/lpe-jointype.cpp @@ -83,6 +83,7 @@ LPEJoinType::~LPEJoinType() void LPEJoinType::doOnApply(SPLPEItem const* lpeitem) { if (SP_IS_SHAPE(lpeitem)) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); SPLPEItem* item = const_cast<SPLPEItem*>(lpeitem); double width = (lpeitem && lpeitem->style) ? lpeitem->style->stroke_width.computed : 1.; @@ -109,8 +110,14 @@ void LPEJoinType::doOnApply(SPLPEItem const* lpeitem) sp_desktop_apply_css_recursive(item, css, true); sp_repr_css_attr_unref (css); - - line_width.param_set_value(width); + Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + + (Glib::ustring)LPETypeConverter.get_key(effectType()).c_str() + + (Glib::ustring)"/" + + (Glib::ustring)"line_width"; + bool valid = prefs->getEntry(pref_path).isValid(); + if(!valid){ + line_width.param_set_value(width); + } line_width.write_to_SVG(); } } diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp index f4a81aa90..a40a40146 100644 --- a/src/live_effects/lpe-taperstroke.cpp +++ b/src/live_effects/lpe-taperstroke.cpp @@ -91,6 +91,7 @@ LPETaperStroke::LPETaperStroke(LivePathEffectObject *lpeobject) : void LPETaperStroke::doOnApply(SPLPEItem const* lpeitem) { if (SP_IS_SHAPE(lpeitem)) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); SPLPEItem* item = const_cast<SPLPEItem*>(lpeitem); double width = (lpeitem && lpeitem->style) ? lpeitem->style->stroke_width.computed : 1.; @@ -117,8 +118,14 @@ void LPETaperStroke::doOnApply(SPLPEItem const* lpeitem) sp_desktop_apply_css_recursive(item, css, true); sp_repr_css_attr_unref (css); - - line_width.param_set_value(width); + Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + + (Glib::ustring)LPETypeConverter.get_key(effectType()).c_str() + + (Glib::ustring)"/" + + (Glib::ustring)"stroke_width"; + bool valid = prefs->getEntry(pref_path).isValid(); + if(!valid){ + line_width.param_set_value(width); + } line_width.write_to_SVG(); } else { printf("WARNING: It only makes sense to apply Taper stroke to paths (not groups).\n"); |
