Unselect saved image when reverting a commit if modified item is unselected
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16938
This commit is contained in:
parent
e9be95741b
commit
22669bcc4d
|
@ -509,8 +509,16 @@ void SCH_COMMIT::Revert()
|
|||
if( view )
|
||||
view->Remove( item );
|
||||
|
||||
bool unselect = !item->IsSelected();
|
||||
|
||||
item->SwapData( copy );
|
||||
|
||||
if( unselect )
|
||||
{
|
||||
item->ClearSelected();
|
||||
item->RunOnChildren( []( SCH_ITEM* aChild ) { aChild->ClearSelected(); } );
|
||||
}
|
||||
|
||||
// Special cases for items which have instance data
|
||||
if( item->GetParent() && item->GetParent()->Type() == SCH_SYMBOL_T
|
||||
&& item->Type() == SCH_FIELD_T )
|
||||
|
|
Loading…
Reference in New Issue