From 28b8919ebce33d1f510c74f7947c912af977f374 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 14 Oct 2023 23:42:25 +0200 Subject: [PATCH] Allow update all corners LPEItem with node tool Fix: https://gitlab.com/inkscape/inkscape/-/issues/4429 --- .../parameter/nodesatellitesarray.cpp | 28 ++++++++++++++++++- .../parameter/nodesatellitesarray.h | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/live_effects/parameter/nodesatellitesarray.cpp b/src/live_effects/parameter/nodesatellitesarray.cpp index 70cc076914..f92aaed3d0 100644 --- a/src/live_effects/parameter/nodesatellitesarray.cpp +++ b/src/live_effects/parameter/nodesatellitesarray.cpp @@ -251,8 +251,33 @@ void NodeSatelliteArrayParam::addKnotHolderEntities(KnotHolder *knotholder, SPIt } } -void NodeSatelliteArrayParam::updateAmmount(double amount) +void sp_update_other_corners(double amount, SPLPEItem *sp_lpe_item, bool write_only) { + if (auto nt = dynamic_cast(SP_ACTIVE_DESKTOP ? SP_ACTIVE_DESKTOP->getTool() : nullptr)) { + for (auto &_shape_editor : nt->_shape_editors) { + Inkscape::UI::ShapeEditor *shape_editor = _shape_editor.second.get(); + if (shape_editor && shape_editor->lpeknotholder) { + if (auto lpeitem = cast(shape_editor->knotholder->getItem())) { + if (lpeitem != sp_lpe_item) { + if (auto corners = dynamic_cast(lpeitem->getCurrentLPE())) { + if (write_only) { + sp_lpe_item_update_patheffect(lpeitem, false, true); + } else { + corners->nodesatellites_param.updateAmmount(amount, false); + sp_lpe_item_update_patheffect(lpeitem, false, false); + } + } + } + } + } + } + } +} + +void NodeSatelliteArrayParam::updateAmmount(double amount, bool initial) { + if (initial) { + sp_update_other_corners(amount, param_effect->sp_lpe_item, false); + } Geom::PathVector const pathv = _last_pathvector_nodesatellites->getPathVector(); NodeSatellites nodesatellites = _last_pathvector_nodesatellites->getNodeSatellites(); for (size_t i = 0; i < nodesatellites.size(); ++i) { @@ -373,6 +398,7 @@ FilletChamferKnotHolderEntity::knot_ungrabbed(Geom::Point const &p, Geom::Point } Inkscape::LivePathEffect::LPEFilletChamfer *filletchamfer = dynamic_cast(_pparam->param_effect); if (filletchamfer) { + sp_update_other_corners(-1, nullptr, true); // write when release in others filletchamfer->helperpath = false; filletchamfer->makeUndoDone(_("Move handle")); } diff --git a/src/live_effects/parameter/nodesatellitesarray.h b/src/live_effects/parameter/nodesatellitesarray.h index 24352e8644..cf11673fdc 100644 --- a/src/live_effects/parameter/nodesatellitesarray.h +++ b/src/live_effects/parameter/nodesatellitesarray.h @@ -58,7 +58,7 @@ public: void setGlobalKnotHide(bool global_knot_hide); void setEffectType(EffectType et); void reloadKnots(); - void updateAmmount(double amount); + void updateAmmount(double amount, bool inital = true); void setPathVectorNodeSatellites(PathVectorNodeSatellites *pathVectorNodeSatellites, bool write = true); void set_oncanvas_looks(Inkscape::CanvasItemCtrlShape shape, -- GitLab