diff options
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"); |
