From ed187d88bf9801e106e45383f140bdd4dbae5f28 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Tue, 24 Dec 2019 09:31:50 +0100 Subject: [PATCH] Fix new cases for this crashing bugs --- src/live_effects/lpe-fillet-chamfer.cpp | 14 +++++++++----- src/live_effects/parameter/satellitesarray.cpp | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 95e995e823..2ec87446da 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -349,7 +349,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) } if (Geom::are_near((*curve_it).initialPoint(), (*curve_it).finalPoint())) { return; - } + } pathresult.append(*curve_it); ++curve_it; } @@ -391,11 +391,9 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) satellites = _pathvector_satellites->getSatellites(); write = true; SPDesktop *desktop = SP_ACTIVE_DESKTOP; - if (desktop) { - SP_ACTIVE_DESKTOP->event_context->_delayed_snap_event = nullptr; - } } } + if (_degenerate_hide) { satellites_param.setGlobalKnotHide(true); } else { @@ -437,7 +435,13 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) _pathvector_satellites->setPathVector(pathvres); _pathvector_satellites->setSatellites(satellites); satellites_param.setPathVectorSatellites(_pathvector_satellites, write); - + size_t number_nodes = count_pathvector_nodes(pathvres); + size_t previous_number_nodes = _pathvector_satellites->getTotalSatellites(); + if (number_nodes != previous_number_nodes) { + doOnApply(lpeItem); // dont want _impl to not update versioning + satellites = satellites_param.data(); + satellites_param.setPathVectorSatellites(_pathvector_satellites, write); + } Glib::ustring current_unit = Glib::ustring(unit.get_abbreviation()); if (previous_unit != current_unit && previous_unit != "") { updateAmount(); diff --git a/src/live_effects/parameter/satellitesarray.cpp b/src/live_effects/parameter/satellitesarray.cpp index 2a43a90372..7f15298cf3 100644 --- a/src/live_effects/parameter/satellitesarray.cpp +++ b/src/live_effects/parameter/satellitesarray.cpp @@ -75,7 +75,7 @@ void SatellitesArrayParam::reloadKnots() Inkscape::UI::ShapeEditor *shape_editor = i->second; if (shape_editor && shape_editor->lpeknotholder) { SPItem *item = shape_editor->knotholder->item; - shape_editor->unset_item(false); + shape_editor->unset_item(true); shape_editor->set_item(item); } } -- GitLab