From 622c2f1316f0662b513fedb4b2de20762bd78f5c Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 11 Feb 2024 20:01:05 -0500 Subject: [PATCH] Make sure connectivity is updated in undo/redo Fixes https://gitlab.com/kicad/code/kicad/-/issues/16945 --- pcbnew/undo_redo.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index 9252acb903..0870d97a3d 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -485,7 +485,11 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) if( IsType( FRAME_PCB_EDITOR ) ) { if( reBuild_ratsnest || deep_reBuild_ratsnest ) + { + // Connectivity may have changed; rebuild internal caches to remove stale items + GetBoard()->BuildConnectivity(); Compile_Ratsnest( false ); + } if( solder_mask_dirty ) HideSolderMask();