SCH_COMMIT: when clearing all item flags, do not clear SELECTED item flags.

If a item is selected, its SELECTED flag cannot be cleared without managing
selections stored in tools, and must be still selected after changes.
Fixes #15671
https://gitlab.com/kicad/code/kicad/-/issues/15671
This commit is contained in:
jean-pierre charras 2023-09-24 11:07:04 +02:00
parent e3285c234a
commit 741c6f2d55
1 changed files with 4 additions and 1 deletions

View File

@ -302,7 +302,10 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
break;
}
schItem->ClearFlags();
// Clear all flags but SELECTED, after edition
// (selected items must keep their selection flag).
const int selected_mask = ( SELECTED | SELECTED_BY_DRAG );
schItem->ClearFlags( EDA_ITEM_ALL_FLAGS - selected_mask );
}
if( schematic )