From 3a6fecc71d2906344f9099382c76cacdc5332095 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 3 Sep 2023 18:09:39 +0200 Subject: [PATCH] Bugfix: cleanup after deleting cells in partial mode - no new top cells appear. --- src/edt/edt/edtPartialService.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/edt/edt/edtPartialService.cc b/src/edt/edt/edtPartialService.cc index 3779cce15..368ddaa39 100644 --- a/src/edt/edt/edtPartialService.cc +++ b/src/edt/edt/edtPartialService.cc @@ -2345,6 +2345,8 @@ PartialService::has_transient_selection () void PartialService::del () { + std::set needs_cleanup; + // stop dragging ui ()->ungrab_mouse (this); @@ -2426,6 +2428,9 @@ PartialService::del () if (r->first.is_cell_inst ()) { const lay::CellView &cv = view ()->cellview (r->first.cv_index ()); if (cv.is_valid ()) { + if (cv->layout ().cell (r->first.back ().inst_ptr.cell_index ()).is_proxy ()) { + needs_cleanup.insert (& cv->layout ()); + } cv->layout ().cell (r->first.cell_index ()).erase (r->first.back ().inst_ptr); } } @@ -2439,6 +2444,11 @@ PartialService::del () m_selection.clear (); m_dragging = false; selection_to_view (); + + // clean up the layouts that need to do so. + for (std::set::const_iterator l = needs_cleanup.begin (); l != needs_cleanup.end (); ++l) { + (*l)->cleanup (); + } } lay::InstanceMarker *