From 63694ab3aa867f5bfbe766e154399c4f1f32a97c Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 3 Oct 2020 01:45:44 +0200 Subject: [PATCH] Mirror symmetry currenty has some problems with some situations so sometimes it create closed paths and other open ones over the split line To fix it we add a versioning to now broke existing works And handle correctly in the future (I select the most often situation that is close the path) This fix is targeted for 1.0.2 for 1.1 I do another tweak that allow open and closed paths over the split line. --- src/live_effects/effect.cpp | 10 ++++++++-- src/live_effects/lpe-mirror_symmetry.cpp | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 785f081ae2..57f35efa5d 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -1297,11 +1297,17 @@ void Effect::doOnApply_impl(SPLPEItem const* lpeitem) { sp_lpe_item = const_cast(lpeitem); is_applied = true; + // we can override "lpeversion" value in each LPE using doOnApply + // this allow to handle legacy LPE and some times update to newest definitions + // In BBB Martin, Mc and Jabiertxof make decission + // of only update this value per each LPE when changes. + // and use the Inkscape release version that has this new LPE change + // LPE without lpeversion are created in a inkscape lower than 1.0 + lpeversion.param_setValue("1", true); doOnApply(lpeitem); setReady(); has_exception = false; - lpeversion.param_setValue("1", true); // we can override this value in each LPE to major versions I dont want to - // repeat inkscape versioning + } void Effect::doBeforeEffect_impl(SPLPEItem const* lpeitem) diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index 080fa1daff..38df0af5d4 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -432,6 +432,7 @@ LPEMirrorSymmetry::doOnApply (SPLPEItem const* lpeitem) end_point.param_update_default(point_b); center_point.param_setValue(point_c, true); previous_center = center_point; + lpeversion.param_setValue("1.0.2", true); } @@ -558,6 +559,9 @@ LPEMirrorSymmetry::doEffect_path (Geom::PathVector const & path_in) } } } + if (lpeversion.param_getSVGValue() > "1.0.1" && original.closed() && !tmp_pathvector[0].closed()) { + tmp_pathvector[0].close(); + } if (cs.size() == 0 && position == 1) { tmp_pathvector.push_back(original); tmp_pathvector.push_back(original * m); -- GitLab