diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-07-11 13:04:12 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-07-14 18:29:22 +0000 |
| commit | 37a3e996eee803fb5d03a09037a71c79de77175d (patch) | |
| tree | c40d78a714c8a09586ef4b002317e9d37d255036 /src/live_effects | |
| parent | working on powerpencil in other thread (diff) | |
| download | inkscape-37a3e996eee803fb5d03a09037a71c79de77175d.tar.gz inkscape-37a3e996eee803fb5d03a09037a71c79de77175d.zip | |
working on redraw
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/lpe-powerstroke.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index 9ca4546f1..d0f6f1fda 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -210,7 +210,7 @@ LPEPowerStroke::doBeforeEffect(SPLPEItem const *lpeItem) void LPEPowerStroke::doOnApply(SPLPEItem const* lpeitem) { - if (SP_IS_SHAPE(lpeitem) && offset_points.data().empty()) { + if (SP_IS_SHAPE(lpeitem)) { SPLPEItem* item = const_cast<SPLPEItem*>(lpeitem); std::vector<Geom::Point> points; Geom::PathVector const &pathv = pathv_to_linear_and_cubic_beziers(SP_SHAPE(lpeitem)->_curve->get_pathvector()); @@ -245,23 +245,28 @@ LPEPowerStroke::doOnApply(SPLPEItem const* lpeitem) sp_repr_css_attr_unref (css); item->updateRepr(); - if (pathv.empty()) { - points.emplace_back(0.2,width ); - points.emplace_back(0.5,width ); - points.emplace_back(0.8,width ); - } else { - Geom::Path const &path = pathv.front(); - Geom::Path::size_type const size = path.size_default(); - if (!path.closed()) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring pref_path_pp = "/live_effects/powerstroke/powerpencil"; + bool powerpencil = prefs->getBool(pref_path_pp, false); + if (!powerpencil) { + if (pathv.empty()) { points.emplace_back(0.2,width ); + points.emplace_back(0.5,width ); + points.emplace_back(0.8,width ); + } else { + Geom::Path const &path = pathv.front(); + Geom::Path::size_type const size = path.size_default(); + if (!path.closed()) { + points.emplace_back(0.2,width ); + } + points.emplace_back(0.5*size,width ); + if (!path.closed()) { + points.emplace_back(size - 0.2,width ); + } } - points.emplace_back(0.5*size,width ); - if (!path.closed()) { - points.emplace_back(size - 0.2,width ); - } + offset_points.param_set_and_write_new_value(points); } offset_points.set_scale_width(scale_width); - offset_points.param_set_and_write_new_value(points); } else { if (!SP_IS_SHAPE(lpeitem)) { g_warning("LPE Powerstroke can only be applied to shapes (not groups)."); |
